public void GetStatesProvinces_NoStatesProvincesFound_ReturnsStatesProvinces( [Frozen] Mock <IReferenceDataApiClient> referenceDataApiClient, ReferenceDataService sut ) { //Arrange referenceDataApiClient.Setup(x => x.GetStatesProvincesAsync( It.IsAny <string>() )) .ReturnsAsync((List <StateProvince>)null); //Act Func <Task> func = async() => await sut.GetStatesProvincesAsync(); //Assert func.Should().Throw <ArgumentNullException>() .WithMessage("Value cannot be null. (Parameter 'statesProvinces')"); }
public async Task GetStatesProvinces_StatesProvincesFound_ReturnsStatesProvinces( [Frozen] Mock <IReferenceDataApiClient> referenceDataApiClient, List <StateProvince> statesProvinces, ReferenceDataService sut ) { //Arrange referenceDataApiClient.Setup(x => x.GetStatesProvincesAsync( It.IsAny <string>() )) .ReturnsAsync(statesProvinces); //Act var response = await sut.GetStatesProvincesAsync(); //Assert response.Count.Should().Be(3); }