Beispiel #1
0
        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>();
        }
Beispiel #2
0
 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()
     });
 }