示例#1
0
        static void Main(string[] args)
        {
            ShopService shopService = new ShopService();

            var product   = shopService.AddNewProduct("Bow", 100, "Good bow");
            var property1 = shopService.GetProperty("Color", "Blue");
            var property2 = shopService.GetProperty("Size", "M");

            shopService.AddProperty(product, property1);
            shopService.AddProperty(product, property2);
            shopService.AddNewProduct(product);
            Console.WriteLine("hi");
            Console.ReadLine();
        }
示例#2
0
        public void CheckAddProperty()
        {
            ShopService ss = new ShopService();

            var product  = ProductObjectMother.CreateProductWithNoPropertiesAndNoBrand();
            var property = ProductObjectMother.CreatePropertyColorWithValueBlue();

            ss.AddProperty(product, property);

            Assert.AreEqual(product.Properties.Contains(property), true);
        }