Example #1
0
        static void Main(string[] args)
        {
            HelloWorldFactory factory = new HelloWorldFactory();
            // create hellowWorld obj
            IHelloWorld helloWorldObj = factory.CreateHelloWorldObj();

            // call any of the implemented function to output "Hello World" to either console or database or other places
            helloWorldObj.PrintHelloWorldToConsole("Hello World");
        }
Example #2
0
        public void SubstituteFor_CreateHelloWorld()
        {
            HelloWorldFactory factory = Substitute.For <HelloWorldFactory>();

            Assert.IsInstanceOf(typeof(ConsoleApp.HelloWorld), factory.CreateHelloWorldObj());
        }