Exemplo n.º 1
0
        public void When_calculating_StockItemBalance_for_date_BalanceAmount_should_not_consider_future_transaction_amounts()
        {
            //var tmpStockTransactionList = new StockTransactionList(Uow);

            //tmpStockTransactionList.Add(new StockTransaction(Uow) { stockItem = new StockItem(Uow) { ID = 1, Name = "Item1" }, Amount = 12, Date = new DateTime(2017, 01, 01), ID = 1, customer = new Customer(Uow) });
            //tmpStockTransactionList.Add(new StockTransaction(Uow) { stockItem = new StockItem(Uow) { ID = 1, Name = "Item1" }, Amount = 1, Date = new DateTime(2017, 01, 02), ID = 2, customer = new Customer(Uow) });
            //tmpStockTransactionList.Add(new StockTransaction(Uow) { stockItem = new StockItem(Uow) { ID = 3, Name = "Item3" }, Amount = 14, Date = new DateTime(2017, 01, 03), ID = 3, customer = new Customer(Uow) });

            var tmpCustomerList = CustomerList.CreateNew(Uow);

            var tmpStockItemist = StockItemList.CreateNew(Uow);

            var tmpStockTransactionList = StockTransactionList.CreateNew(Uow, tmpStockItemist, tmpCustomerList, new DateTime(2017, 01, 03), StockTransactionList.FillDirection.Afterdate);

            var retResult = tmpStockTransactionList.CalculateBalanceForStockItem(tmpStockItemist.GetItemByid(1), new DateTime(2017, 01, 05));
        }
Exemplo n.º 2
0
        public void StockTransaction_Number_should_be_calculated_for_the_Customer_and_Year_of_the_StockTransaction()
        {
            //var tmpStockTransactionList = new StockTransactionList(Uow);

            //tmpStockTransactionList.Add(new StockTransaction(Uow) { stockItem = new StockItem(Uow) { ID = 1, Name = "Item1" }, Amount = 12, Date = new DateTime(2017, 01, 01), ID = 1, customer = new Customer(Uow) });
            //tmpStockTransactionList.Add(new StockTransaction(Uow) { stockItem = new StockItem(Uow) { ID = 1, Name = "Item1" }, Amount = 1, Date = new DateTime(2017, 01, 02), ID = 2, customer = new Customer(Uow) });
            //tmpStockTransactionList.Add(new StockTransaction(Uow) { stockItem = new StockItem(Uow) { ID = 3, Name = "Item3" }, Amount = 14, Date = new DateTime(2017, 01, 03), ID = 3, customer = new Customer(Uow) });


            var tmpCustomerList = CustomerList.CreateNew(Uow);

            var tmpStockItemist = StockItemList.CreateNew(Uow);

            var tmpStockTransactionList = StockTransactionList.CreateNew(Uow, tmpStockItemist, tmpCustomerList, DateTime.Now.Date, StockTransactionList.FillDirection.Beforedate);

            tmpStockTransactionList.CalculateBalanceForStockItem(tmpStockItemist.GetItemByid(1), new DateTime(2017, 3, 20));
        }
Exemplo n.º 3
0
        public void When_calculating_StockItemBalance_for_date_BalanceAmount_should_be_sum_of_all_previous_transactions_amounts()
        {
            //StockTransactionMethods.CalculateBalanceForStockItem(StockItem item, DateTime date)..

            // Session.CreateObjectTypeRecords


            var tmpCustomerList = CustomerList.CreateNew(Uow);

            var tmpStockItemist = StockItemList.CreateNew(Uow);

            var tmpStockTransactionList = StockTransactionList.CreateNew(Uow, tmpStockItemist, tmpCustomerList, new DateTime(2017, 03, 03), StockTransactionList.FillDirection.Beforedate);

            var count = tmpStockTransactionList.CalculateBalanceForStockItem(tmpStockItemist.GetItemByid(9), new DateTime(2017, 02, 27));

            //var customer = new BaseClass(Uow);
            //Uow.CommitChanges();
        }