示例#1
0
        public void Check_Three_Milks_Same_As_Four_Test()
        {
            Butter butter = new Butter(0, 0.80M);
            Bread  bread  = new Bread(0, 1.00M, butter);
            Milk   milk   = new Milk(3, 1.15M);

            var actual_3Milks = butter.GetOffers() + bread.GetOffers() + milk.GetOffers();

            milk.Count = 4;
            var actual_4Milks = butter.GetOffers() + bread.GetOffers() + milk.GetOffers();

            Assert.Equal(actual_3Milks, actual_4Milks);
        }
示例#2
0
        public void Butter_Basic_Test()
        {
            Butter butter = new Butter(1, 1.0M);

            var actual = butter.GetOffers();

            Assert.Equal(1.0M, actual);
        }
示例#3
0
        public void Check_Four_Butter_Two_Bread_Offer_Test()
        {
            Butter butter = new Butter(4, 0.80M);
            Bread  bread  = new Bread(2, 1.00M, butter);

            var actual = bread.GetOffers() + butter.GetOffers();

            Assert.Equal(4.20M, actual);
        }
示例#4
0
        public void Check_Three_Butter_Zero_Bread_Offer_Test()
        {
            Butter butter = new Butter(3, 0.80M);
            Bread  bread  = new Bread(0, 1.00M, butter);

            var actual = bread.GetOffers() + butter.GetOffers();

            Assert.Equal(2.40M, actual);
        }
示例#5
0
        public void Scenario_3_Test()
        {
            Butter butter = new Butter(0, 0.80M);
            Bread  bread  = new Bread(0, 1.00M, butter);
            Milk   milk   = new Milk(4, 1.15M);

            var actual = butter.GetOffers() + bread.GetOffers() + milk.GetOffers();

            Assert.Equal(3.45M, actual);
        }