public void CanExecute_ShouldReturnErrorOnCreditScore() { var handler = this.CreateHandler(requiredCreditScore: 150); var gatherContractInfoRequest = new GatherContactInfoRequest(Name, Address, this.dateOfBirth, NationalInsuranceNumber); var gatherContractInfoResponse = handler.Handle(gatherContractInfoRequest); gatherContractInfoResponse.Errors.Count().Should().Be(1); }
public void CanExecute_ShouldReturnErrorOnNiNumber() { var handler = this.CreateHandler(requiredCreditScore: 600); var gatherContractInfoRequest = new GatherContactInfoRequest(Name, Address, this.dateOfBirth, string.Empty); var gatherContractInfoResponse = handler.Handle(gatherContractInfoRequest); gatherContractInfoResponse.Errors.Count().Should().Be(1); }
public void CanExecute_ShouldReturnErrorOnAge() { var handler = this.CreateHandler(requiredCreditScore: 600); var gatherContractInfoRequest = new GatherContactInfoRequest(Name, Address, DateTime.Now.AddYears(-1), NationalInsuranceNumber); var gatherContractInfoResponse = handler.Handle(gatherContractInfoRequest); gatherContractInfoResponse.Errors.Count().Should().Be(1); }
public GatherContactInfoResponse GatherContactInfo([FromBody] GetContactInfoDTO getContactInfo) { if (getContactInfo is null) { throw new ArgumentNullException(nameof(getContactInfo)); } var request = new GatherContactInfoRequest( getContactInfo.Name, getContactInfo.Address, getContactInfo.DateOfBirth, getContactInfo.NationalInsuranceNumber); var requestHandler = new GatherContactInfoInteractor( this._creditScoreService, this._customerDatabase); return(requestHandler.Handle(request)); }
public void CanCreate() { var gatherContractInfoRequest = new GatherContactInfoRequest(Name, Address, this.dateOfBirth, NationalInsuranceNumber); gatherContractInfoRequest.Should().NotBeNull(); }