Esempio n. 1
0
        public void MountainBikeShop_OrderBike_ReturnsInstanceOfMountainBike()
        {
            // Arrange
            IBikeShop shop = new MountainBikeShop();

            // Act
            IBike bike = shop.OrderBike("test");

            // Assert
            Assert.IsInstanceOfType(bike, typeof(MountainBike));
        }
Esempio n. 2
0
        public static void Run()
        {
            Console.WriteLine($"{Environment.NewLine}*** ABSTRACT FACTORY PATTERN ***{Environment.NewLine}");

            IBikeShop mShop = new MountainBikeShop();
            IBikeShop rShop = new RoadBikeShop();
            IBikeShop hShop = new HybridBikeShop();

            mShop.OrderBike("Muddy");
            rShop.OrderBike("Missile");
            hShop.OrderBike("Cruser");
        }