Exemplo n.º 1
0
 public void TestDeleteContract()
 {
     ClosureContractStock closureContractStock = new ClosureContractStock();
     Loan contract1 = new Loan(new User(), ApplicationSettings.GetInstance(""), NonWorkingDateSingleton.GetInstance(""), ProvisionTable.GetInstance(new User()), ChartOfAccounts.GetInstance(new User()))
                            {Id = 1};
     Loan contract2 = new Loan(new User(), ApplicationSettings.GetInstance(""), NonWorkingDateSingleton.GetInstance(""), ProvisionTable.GetInstance(new User()), ChartOfAccounts.GetInstance(new User()))
                            {Id = 2};
     closureContractStock.AddContract(contract1);
     closureContractStock.AddContract(contract2);
     Assert.AreEqual(2,closureContractStock.Contracts.Count);
     closureContractStock.DeleteContract(contract1.Id);
     Assert.AreEqual(1,closureContractStock.Contracts.Count);
 }
Exemplo n.º 2
0
 public void TestGetWriteOffContracts()
 {
     ClosureContractStock closureContractStock = new ClosureContractStock();
     Loan contract1 = new Loan(new User(), ApplicationSettings.GetInstance(""), NonWorkingDateSingleton.GetInstance(""), ProvisionTable.GetInstance(new User()), ChartOfAccounts.GetInstance(new User()))
                            {Id = 1};
     Loan contract2 = new Loan(new User(), ApplicationSettings.GetInstance(""), NonWorkingDateSingleton.GetInstance(""), ProvisionTable.GetInstance(new User()), ChartOfAccounts.GetInstance(new User()));
     contract2.Events.Add(new WriteOffEvent());
     contract2.Id = 2;
     contract2.WrittenOff = true;
     closureContractStock.AddContract(contract1);
     closureContractStock.AddContract(contract2);
     Assert.AreEqual(1,closureContractStock.WriteOffContracts.Count);
 }
Exemplo n.º 3
0
 public void TestIsWriteOffContractWhenItIsNot()
 {
     ClosureContractStock closureContractStock = new ClosureContractStock();
     Loan contract1 = new Loan(new User(), ApplicationSettings.GetInstance(""), NonWorkingDateSingleton.GetInstance(""), ProvisionTable.GetInstance(new User()), ChartOfAccounts.GetInstance(new User()))
                            {Id = 1};
     closureContractStock.AddContract(contract1);
     Assert.IsFalse(closureContractStock.IsWriteOffContract(contract1));
 }
Exemplo n.º 4
0
 public void TestAddContract()
 {
     ClosureContractStock closureContractStock = new ClosureContractStock();
     closureContractStock.AddContract(new Loan(new User(), ApplicationSettings.GetInstance(""), NonWorkingDateSingleton.GetInstance(""), ProvisionTable.GetInstance(new User()), ChartOfAccounts.GetInstance(new User())));
     Assert.AreEqual(1,closureContractStock.Contracts.Count);
 }