コード例 #1
0
        public void CanGetAndSetPound()
        {
            var expected = new Random().Next();
            var target   = new KartItem()
            {
                Pound = expected
            };

            Assert.Equal(expected, target.Pound);
        }
コード例 #2
0
        public void CanGetAndSetCost()
        {
            var expected = new Random().Next();
            var target   = new KartItem()
            {
                Cost = expected
            };

            Assert.Equal(expected, target.Cost);
        }
コード例 #3
0
        public void CanGetAndSetItem()
        {
            var expected = new Random().ToString();
            var target   = new KartItem()
            {
                Item = expected
            };

            Assert.Equal(expected, target.Item);
        }
コード例 #4
0
        public static string BuyOneGetOneFree(KartItem product)
        {
            Kart kart = new Kart();

            foreach (var item in kart.GetKart())
            {
                if (product == item)
                {
                    for (int i = 0; i < item.Cost; i++)
                    {
                    }

                    return("Your get one buy one credit applied today ! ");
                }
            }
            return("There is no discount for your item at this time");
        }