예제 #1
0
        private static void testStoreListCompactSize()
        {
            Console.WriteLine("\n# testStore()");
            Store store = new Store();
            store.addBed("Foxtrot", Room.LivingRoom, Material.Pine, new Size(100, 45, 210), 230, Mattress.Healthy, false, true, false, 4);
            store.addBed("BedNoCompactSize", Room.LivingRoom, Material.Pine, new Size(100, 45, 210), 230, Mattress.Healthy, false, false, false, 4);
            store.addTable("Tango", Room.Kitchen, Material.Oak, new Size(80, 90, 100), 120, 4, false, true, 6);
            store.addTable("TableNoCompactSize", Room.Kitchen, Material.Oak, new Size(80, 90, 100), 120, 4, false, false, 6);
            store.addWardrobe("John", Room.Bedroom, Material.CherryTree, new Size(50, 160, 90), 180, 3, DoorType.Sliding, true, false, 2);

            Console.WriteLine(store);

            Console.WriteLine("List CompactSizeCapable furniture");
            List<AbstractFurniture> elements = store.listAllCompactSizeCapableFurniture();
            foreach (AbstractFurniture furniture in elements)
            {
                Console.WriteLine(furniture);
            }
            // 2 item: Foxtrot and Tango --> Bed or Table, and value of CompactSize is True
        }
예제 #2
0
        private static void testStoreWithEquals()
        {
            Console.WriteLine("\n# testStoreWithEquals()");
            Store store = new Store();
            store.addBed("Foxtrot", Room.LivingRoom, Material.Pine, new Size(100, 45, 210), 230, Mattress.Healthy, false, true, false, 4);
            store.addTable("Tango", Room.Kitchen, Material.Oak, new Size(80, 90, 100), 120, 4, false, true, 6);
            store.addWardrobe("John", Room.Bedroom, Material.CherryTree, new Size(50, 160, 90), 180, 3, DoorType.Sliding, true, false, 2);
            Console.WriteLine(store);
            store.addBed("Foxtrot", Room.LivingRoom, Material.Pine, new Size(100, 45, 210), 230, Mattress.Healthy, false, true, false, 1);
            store.addTable("Tango", Room.Kitchen, Material.Oak, new Size(80, 90, 100), 120, 4, false, true, 1);
            store.addWardrobe("John", Room.Bedroom, Material.CherryTree, new Size(50, 160, 90), 180, 3, DoorType.Sliding, true, false, 1);

            // With Equals: 5 Foxtrot, 7 Tango, 3 John
            // Without Equals: 4 Foxtrot, 6 Tango, 2 John, 1 Foxtrot, 1 Tango, 1 John !!!

            Console.WriteLine(store);
        }
예제 #3
0
        private static void testStore()
        {
            Console.WriteLine("\n# testStore()");
            Store store = new Store();
            store.addFurniture(new Bed("Foxtrot", Room.LivingRoom, Material.Pine, new Size(100, 45, 210), 230, Mattress.Healthy, false, true, false), 4);
            // store.addBed("Foxtrot", Room.LivingRoom, Material.Pine, new Size(100, 45, 210), 230, Mattress.Healthy, false, true, false, 4);
            store.addTable("Tango", Room.Kitchen, Material.Oak, new Size(80, 90, 100), 120, 4, false, true, 6);
            store.addWardrobe("John", Room.Bedroom, Material.CherryTree, new Size(50, 160, 90), 180, 3, DoorType.Sliding, true, false, 2);

            Console.WriteLine(store);
            Console.WriteLine(store.addFurniture("Foxtrot", 1) + "\n");
            Console.WriteLine(store);
            Console.WriteLine(store.sell("Tango", 2) + "\n");
            Console.WriteLine(store);
        }