Пример #1
0
        public void GetDiscountsByProductSkuTest()
        {
            mockSecurityHelper.UserToReturn = "ContosoPartner1";

            TestablePricing target = new TestablePricing();

            target.ReplacementSecurityHelper = mockSecurityHelper;

            int     expectedCount      = 1;
            string  expectedId         = "1";
            string  expectedPartnerId  = "ContosoPartner1";
            string  expectedProductSku = "1000000000";
            string  expectedName       = "2 for 1";
            decimal expectedValue      = 50M;

            IList <Discount> actual;

            actual = target.GetDiscountsBySku("1000000000");

            Assert.AreEqual(expectedCount, actual.Count);
            Assert.AreEqual(expectedId, actual[0].Id);
            Assert.AreEqual(expectedPartnerId, actual[0].PartnerId);
            Assert.AreEqual(expectedProductSku, actual[0].ProductSku);
            Assert.AreEqual(expectedName, actual[0].Name);
            Assert.AreEqual(expectedValue, actual[0].Value);
        }
Пример #2
0
        public void GetDiscountsByProductDiscountsNotFoundTest()
        {
            mockSecurityHelper.UserToReturn = "ContosoPartner1";

            TestablePricing target = new TestablePricing();

            target.ReplacementSecurityHelper = mockSecurityHelper;

            int expectedCount = 0;

            IList <Discount> actual;

            actual = target.GetDiscountsBySku("9999");

            Assert.AreEqual(expectedCount, actual.Count);
        }