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!"); }
static void Main(string[] args) { var writer = BaseWriter.Get <ConsoleWriter>(); writer.Write("Hello World"); }
public void FactoryMethodGetsConsoleWriter() { var writer = BaseWriter.Get <ConsoleWriter>(); Assert.IsTrue(writer is ConsoleWriter); }
public void FactoryMethodGetsDatabaseWriter() { var writer = BaseWriter.Get <DatabaseWriter>(); Assert.IsTrue(writer is DatabaseWriter); }