I create a test case for null argument check but got this error : Expected a <System.ArgumentNullException> to be thrown, but found a <System.NullReferenceException>: System.NullReferenceException with message "Object reference not set to an instance of an object."
[Fact]
public void GivenNull_WhenMapIsCalled_ThenArgumentNullExceptionIsThrown()
{
//Given
Request request = null;
//When
Action action = () => new ConsumerServiceWrapper().IndividualsSearch(request);
//Then
action.ShouldThrow<ArgumentNullException>();
}
Individual Search
public List<Response> IndividualsSearch(Request request)
{
var response = new List<Response>();
//some code
return response;
}