public void IfGatewayReturnsNullThrowNotFoundException() { TaxPayerInformation nullResult = null; _mockAcademyGateway.Setup(x => x.GetTaxPayerById(It.IsAny <int>())) .Returns(nullResult); Func <TaxPayerInformationResponse> testDelegate = () => _classUnderTest.Execute(456); testDelegate.Should().Throw <TaxPayerNotFoundException>(); }
public static TaxPayerInformationResponse ToResponse(this TaxPayerInformation taxPayerInfo) { return(new TaxPayerInformationResponse { AccountRef = taxPayerInfo.AccountRef, UPRN = taxPayerInfo.Uprn, EmailList = taxPayerInfo.EmailList, PhoneNumberList = taxPayerInfo.PhoneNumberList, FirstName = taxPayerInfo.FirstName, LastName = taxPayerInfo.LastName, TaxPayerAddress = taxPayerInfo.TaxPayerAddress.ToResponse() }); }