コード例 #1
0
        public void TestAddPromotion()
        {
            //Arrange
            IPromotionManager promotionManager = new PromotionManager(_promotionAccessor);
            Promotion         promotion        = new Promotion()
            {
                PromotionID     = "TESTPROMO",
                PromotionTypeID = "Percent",
                Discount        = 0.95M,
                Description     = "Test Description",
                StartDate       = DateTime.Today,
                EndDate         = DateTime.Today.AddDays(1)
            };

            promotion.Products.Add(new Product()
            {
                ProductID   = "1234567890123",
                ItemID      = 10000,
                Brand       = "Test Brand",
                Category    = "Test Category",
                Name        = "Test Product",
                Taxable     = true,
                Type        = "Test Type",
                Description = "Test product description",
                Price       = 1.00M
            });
            bool expectedResult = true;
            //Act
            bool actualResult = promotionManager.AddPromotion(promotion);

            //Assert
            Assert.AreEqual(expectedResult, actualResult);
        }