public async Task <IActionResult> Post(Donor donor) { if (!ModelState.IsValid) { return(BadRequest()); } await _aidRepository.SaveDonor(donor); var response = _declarationService.PrepareDeclaration(donor.DonationAmount); return(Ok(response)); }
public void PrepareDeclaration() { //Arrange double donationAmount = 150; var expected = new GiftAidDeclarationResponse() { DeclarationId = Guid.NewGuid(), GiftAidAmount = 1.875 }; //Act var actual = _declarationService.PrepareDeclaration(donationAmount); //Assert Assert.IsType <GiftAidDeclarationResponse>(actual); Assert.Equal(actual.GiftAidAmount, expected.GiftAidAmount); }