Example #1
0
        static void Main(string[] args)
        {
            // to demonstrate reuse of business object and extensibility of base classes in a separate project
            var writer = BaseWriter.Get <DatabaseWriter>();

            writer.Write("Hello Database!");
        }
Example #2
0
        static void Main(string[] args)
        {
            var writer = BaseWriter.Get <ConsoleWriter>();

            writer.Write("Hello World");
        }
Example #3
0
        public void FactoryMethodGetsConsoleWriter()
        {
            var writer = BaseWriter.Get <ConsoleWriter>();

            Assert.IsTrue(writer is ConsoleWriter);
        }
Example #4
0
        public void FactoryMethodGetsDatabaseWriter()
        {
            var writer = BaseWriter.Get <DatabaseWriter>();

            Assert.IsTrue(writer is DatabaseWriter);
        }