Exemplo n.º 1
0
        public void DealPaymentDocumentTest_Adding_DealPaymentFromClient_With_Cash_To_Deal_Must_Set_DealPaymentSum_CashDealPaymentSum_UndistributedDealPaymentFromClientSum()
        {
            // Создаем оплату от клиента
            var currentDate           = DateTime.Now;
            var dealPaymentFromClient = new DealPaymentFromClient(team.Object, user.Object, "002", new DateTime(2012, 2, 19), 600M, DealPaymentForm.Cash, currentDate);

            Assert.IsNull(dealPaymentFromClient.Deal);
            Assert.AreEqual(0M, deal.DealPaymentSum);
            Assert.AreEqual(0M, deal.CashDealPaymentSum);
            Assert.AreEqual(0M, deal.UndistributedDealPaymentFromClientSum);

            // Act
            deal.AddDealPaymentDocument(dealPaymentFromClient);

            Assert.AreEqual(deal, dealPaymentFromClient.Deal);
            Assert.AreEqual(600M, deal.DealPaymentSum);
            Assert.AreEqual(600M, deal.CashDealPaymentSum);
            Assert.AreEqual(600M, deal.UndistributedDealPaymentFromClientSum);
        }