static void Main(string[] args)
        {
            const string dashes = "-----";

            Console.WriteLine(string.Format("{0}Singleton{0}", dashes));
            SingletonTest.Run();
            Console.WriteLine(string.Format("{0}Prototype{0}", dashes));
            PrototypeTest.Run();
            Console.WriteLine(string.Format("{0}Factory{0}", dashes));
            FactoryTest.Run();
            Console.WriteLine(string.Format("{0}Builder{0}", dashes));
            BuilderTest.Run();
            Console.WriteLine(string.Format("{0}Decorator{0}", dashes));
            DecoratorTest.Run();

            Console.WriteLine("\nPress any key to continue...");
            Console.ReadKey();
        }
示例#2
0
        static void Main(string[] args)
        {
            TestAbstractFactory testAbstractFactory = new TestAbstractFactory();

            testAbstractFactory.Test();

            TestContinentFactory testContinentFactory = new TestContinentFactory();

            testContinentFactory.Test();

            BuilderTest builderTest = new BuilderTest();

            builderTest.Test();

            ShopTest shopTest = new ShopTest();

            shopTest.Test();

            FactoryTest factoryTest = new FactoryTest();

            factoryTest.Test();

            PageFactoryTest pageFactoryTest = new PageFactoryTest();

            pageFactoryTest.Test();

            PrototypeTest prototypeTest = new PrototypeTest();

            prototypeTest.Test();

            ColorPrototypeTest colorPrototypeTest = new ColorPrototypeTest();

            colorPrototypeTest.Test();

            SingletonTest singletonTest = new SingletonTest();

            singletonTest.Test();

            LoadBalancerTest loadBalancerTest = new LoadBalancerTest();

            loadBalancerTest.Test();

            AdapterTest adapterTest = new AdapterTest();

            adapterTest.Test();

            CompoundTest compoundTest = new CompoundTest();

            compoundTest.Test();

            BridgeTest bridgeTest = new BridgeTest();

            bridgeTest.Test();

            CustomersTest customersTest = new CustomersTest();

            customersTest.Test();

            ComponentTest componentTest = new ComponentTest();

            componentTest.Test();

            DrawingElementTest drawingElementTest = new DrawingElementTest();

            drawingElementTest.Test();

            AbstractComponentTest abstractComponentTest = new AbstractComponentTest();

            abstractComponentTest.Test();

            LibraryItemTest libraryItemTest = new LibraryItemTest();

            libraryItemTest.Test();

            FacadeTest facadeTest = new FacadeTest();

            facadeTest.Test();

            MortgageTest mortgageTest = new MortgageTest();

            mortgageTest.Test();

            FlyweightFactoryTest flyweightFactoryTest = new FlyweightFactoryTest();

            flyweightFactoryTest.Test();

            HandlerTest handlerTest = new HandlerTest();

            handlerTest.Test();

            ApproverTest approverTest = new ApproverTest();

            approverTest.Test();

            CommandTest commandTest = new CommandTest();

            commandTest.Test();

            UserTest userTest = new UserTest();

            userTest.Test();

            Console.ReadKey();
        }