public async Task ShouldRaiseError_CreateLoanAgreement_UsingInvalidFinancierID() { var model = new CreateLoanAgreementInfo { Id = Guid.NewGuid(), FinancierId = new Guid("44448229-7ede-4834-825a-0c55bde75695"), LoanAmount = 10000, InterestRate = .006, LoanDate = new DateTime(2021, 1, 5), MaturityDate = new DateTime(2022, 1, 5), PaymentsPerYear = 12, UserId = UserId.Create(new Guid("660bb318-649e-470d-9d2b-693bfb0b2744")) }; await Assert.ThrowsAsync <InvalidOperationException>(async() => await _cmdHdlr.Handle(model)); }
public async Task ShouldInsert_LoanAgreement_UsingCreateLoanAgreementInfoWriteModel() { Guid id = Guid.NewGuid(); var model = new CreateLoanAgreementInfo { Id = id, FinancierId = new Guid("12998229-7ede-4834-825a-0c55bde75695"), LoanAmount = 10000, InterestRate = .006, LoanDate = new DateTime(2021, 1, 5), MaturityDate = new DateTime(2022, 1, 5), PaymentsPerYear = 12, UserId = UserId.Create(new Guid("660bb318-649e-470d-9d2b-693bfb0b2744")) }; await _cmdHdlr.Handle(model); LoanAgreement result = await _dbContext.LoanAgreements.FindAsync(id); Assert.NotNull(result); }