示例#1
0
        public async Task ShouldInsert_LoanAgreementAndLoanPymt_UsingLoanAgreementAggregate()
        {
            LoanAgreement agreement = new LoanAgreement
                                      (
                new EconomicEvent(Guid.NewGuid(), EventType.CashReceiptFromLoanAgreement),
                FinancierId.Create(new Guid("b49471a0-5c1e-4a4d-97e7-288fb0f6338a")),
                LoanAmount.Create(175000),
                InterestRate.Create(.0675),
                LoanDate.Create(new DateTime(2021, 11, 5)),
                MaturityDate.Create(new DateTime(2022, 11, 5)),
                PaymentsPerYear.Create(12),
                UserId.Create(new Guid("660bb318-649e-470d-9d2b-693bfb0b2744"))
                                      );

            LoanPayment loanPayment = new LoanPayment
                                      (
                new EconomicEvent(Guid.NewGuid(), EventType.CashDisbursementForLoanPayment),
                agreement,
                PaymentNumber.Create(1),
                PaymentDueDate.Create(new DateTime(2021, 12, 5)),
                LoanPrincipalAmount.Create(14135),
                LoanInterestAmount.Create(984),
                LoanPrincipalRemaining.Create(160862),
                UserId.Create(new Guid("660bb318-649e-470d-9d2b-693bfb0b2744"))
                                      );

            agreement.AddLoanPayment(loanPayment);
            await _loanAgreementRepo.AddAsync(agreement);

            await _unitOfWork.Commit();

            var result = await _loanAgreementRepo.Exists(agreement.Id);

            Assert.True(result);    //TODO Test navigation to LoanPayment
        }
示例#2
0
        public async Task ShouldInsert_LoanPymt_UsingLoanAgreementAggregate()
        {
            LoanAgreement agreement = await _loanAgreementRepo.GetByIdAsync(new Guid("0a7181c0-3ce9-4981-9559-157fd8e09cfb"));

            EconomicEvent economicEvent = new EconomicEvent(Guid.NewGuid(), EventType.CashDisbursementForLoanPayment);
            await _loanAgreementRepo.AddEconomicEventAsync(economicEvent);

            LoanPayment loanPayment = new LoanPayment
                                      (
                economicEvent,
                agreement,
                PaymentNumber.Create(1),
                PaymentDueDate.Create(new DateTime(2021, 12, 5)),
                LoanPrincipalAmount.Create(14135.13M),
                LoanInterestAmount.Create(984),
                LoanPrincipalRemaining.Create(160862.13M),
                UserId.Create(new Guid("660bb318-649e-470d-9d2b-693bfb0b2744"))
                                      );

            agreement.AddLoanPayment(loanPayment);
            _loanAgreementRepo.Update(agreement);
            await _unitOfWork.Commit();

            LoanPayment result = agreement.LoanPayments.FirstOrDefault(p => p.Id == loanPayment.EconomicEvent.Id);

            Assert.NotNull(result);
        }
        public void PaymentDueDateBox()
        {
            var    text_input  = driver.FindElement(By.XPath(".//*[@id='Form1']/table/tbody/tr[1]/td/table/tbody/tr[1]/td[2]/font")).Text;
            var    result      = text_input.Substring(text_input.Length - 11);
            string currentDate = result.Remove(result.Length - 2);

            PaymentDueDate.SendKeys(currentDate + "8");
        }
 public void Configure(EntityTypeBuilder <LoanPayment> entity)
 {
     entity.ToTable("LoanPaymentSchedules", schema: "Finance");
     entity.HasKey(e => e.Id);
     entity.Property(p => p.Id).HasColumnType("UNIQUEIDENTIFIER").HasColumnName("LoanPaymentId");
     entity.HasOne(p => p.EconomicEvent).WithOne().HasForeignKey <LoanPayment>(p => p.Id);
     entity.HasOne(p => p.LoanAgreement).WithMany(p => p.LoanPayments).HasForeignKey(p => p.LoanId);
     entity.Property(p => p.LoanId)
     .HasColumnType("UNIQUEIDENTIFIER")
     .HasColumnName("LoanId")
     .IsRequired();
     entity.Property(p => p.PaymentNumber)
     .HasConversion(p => p.Value, p => PaymentNumber.Create(p))
     .HasColumnType("int")
     .HasColumnName("PaymentNumber")
     .IsRequired();
     entity.Property(p => p.PaymentDueDate)
     .HasConversion(p => p.Value, p => PaymentDueDate.Create(p))
     .HasColumnType("DATETIME2(0)")
     .HasColumnName("PaymentDueDate")
     .IsRequired();
     entity.Property(p => p.LoanPrincipalAmount)
     .HasConversion(p => p.Value, p => LoanPrincipalAmount.Create(p))
     .HasColumnType("DECIMAL(18,2)")
     .HasColumnName("PrincipalAmount")
     .IsRequired();
     entity.Property(p => p.LoanInterestAmount)
     .HasConversion(p => p.Value, p => LoanInterestAmount.Create(p))
     .HasColumnType("DECIMAL(18,2)")
     .HasColumnName("InterestAmount")
     .IsRequired();
     entity.Property(p => p.LoanPrincipalRemaining)
     .HasConversion(p => p.Value, p => LoanPrincipalRemaining.Create(p))
     .HasColumnType("DECIMAL(18,2)")
     .HasColumnName("PrincipalRemaining")
     .IsRequired();
     entity.Property(p => p.UserId)
     .HasConversion(p => p.Value, p => UserId.Create(p))
     .HasColumnType("UNIQUEIDENTIFIER")
     .HasColumnName("UserId")
     .IsRequired();
     entity.Property(e => e.CreatedDate)
     .HasColumnType("datetime2(7)")
     .ValueGeneratedOnAdd()
     .HasDefaultValueSql("sysdatetime()");
     entity.Property(e => e.LastModifiedDate).HasColumnType("datetime2(7)");
 }
示例#5
0
        public async Task ShouldUpdate_LoanPayment_UsingLoanAgreementAggregate()
        {
            LoanAgreement agreement = await _loanAgreementRepo.GetByIdAsync(new Guid("1511c20b-6df0-4313-98a5-7c3561757dc2"));

            LoanPayment payment = agreement.LoanPayments.FirstOrDefault(p => p.Id == new Guid("2205ebde-58dc-4af7-958b-9124d9645b38"));

            payment.UpdatePaymentDueDate(PaymentDueDate.Create(new DateTime(2021, 1, 10)));
            payment.UpdateLoanInterestAmount(LoanInterestAmount.Create(360.07M));

            agreement.UpdateLoanPayment(payment);
            await _unitOfWork.Commit();

            LoanPayment result = agreement.LoanPayments.FirstOrDefault(p => p.Id == new Guid("2205ebde-58dc-4af7-958b-9124d9645b38"));

            Assert.Equal(new DateTime(2021, 1, 10), result.PaymentDueDate);
            Assert.Equal(360.07M, result.LoanInterestAmount);
        }
示例#6
0
        internal void TenantDetails4mExcel()
        {
            ExcelLib.PopulateInCollection(Base.ExcelPath, "TenantDetails");
            Driver.wait(2);
            Assert.IsTrue(Driver.driver.PageSource.Contains("Tenant Email"));
            try
            {
                bool bEmail = TenantEmailId.Enabled;
                if (bEmail)
                {
                    TenantEmailId.SendKeys(ExcelLib.ReadData(3, "EmailId"));
                    Base.test.Log(RelevantCodes.ExtentReports.LogStatus.Pass, "Email Id field is enabled and value from excel sheet passed");
                    IsMainTenant.Click();
                    //Verify first name field and last name is emabled or not
                    bool bFName = TenantFirstName.Enabled;
                    if (bFName)
                    {
                        TenantFirstName.SendKeys(ExcelLib.ReadData(3, "FirstName"));
                        TenantLastName.SendKeys(ExcelLib.ReadData(3, "LastName"));
                        Base.test.Log(RelevantCodes.ExtentReports.LogStatus.Info, "Its a new email id; First Name and Last name filled with Excel sheet");
                    }
                    else
                    {
                        Base.test.Log(RelevantCodes.ExtentReports.LogStatus.Info, "First Name & Last Name has been auto filled with the email id");
                    }
                    TenantStartDate.Click();
                    //verify Rent amount field is enabled or not
                    bool bRentField = RentAmount.Enabled;
                    if (bRentField)
                    {
                        RentAmount.SendKeys(ExcelLib.ReadData(3, "RentAmount"));
                        decimal d;

                        if (decimal.TryParse(ExcelLib.ReadData(3, "RentAmount"), out d))
                        {
                            PaymentFrequncy.Click();
                            Driver.wait(5);
                            Base.test.Log(RelevantCodes.ExtentReports.LogStatus.Pass, "Rent Amount field has been verified for decimal values");
                            PaymentStartDate.Click();

                            PaymentDueDate.Click();
                            if (ButtonSave.Enabled)
                            {
                                ButtonSave.Click();
                                Base.test.Log(RelevantCodes.ExtentReports.LogStatus.Pass, "All the field has been entered on Add Tenant page");
                            }
                            else
                            {
                                Base.test.Log(RelevantCodes.ExtentReports.LogStatus.Fail, "Some of the fields on Add tenant Page need sto be cross verified, Next button is not enabled ");
                            }
                        }
                        else
                        {
                            Base.test.Log(RelevantCodes.ExtentReports.LogStatus.Fail, "Rent Amount field has been verified for decimal values");
                        }
                    }
                    else
                    {
                        Base.test.Log(RelevantCodes.ExtentReports.LogStatus.Fail, "Rent amount field is not enabled");
                    }
                }
                else
                {
                    Base.test.Log(RelevantCodes.ExtentReports.LogStatus.Fail, "Email Id Field is not enabled");
                }

                //ClickNewLiability.Click();
                //LiabilityName.Click();
                //LiabilityAmount.SendKeys(ExcelLib.ReadData(2, "LiabilityAmount"));
                //Driver.wait(5);
                //ButtonSave.Click();
            }
            catch (Exception ex)
            {
                string exMesg = ex.Message;
                Base.test.Log(RelevantCodes.ExtentReports.LogStatus.Fail, "Exception Message thrown:" + exMesg);
            }
        }