Beispiel #1
0
        static void Main(string[] args)
        {
            IMessageFacade oFacade = new HelloWorldFacade(new ConsoleHelloWorldMessage());

            Console.WriteLine(oFacade.RenderMessage());

            oFacade = new HelloWorldFacade(new WebApplicationHelloWorldMessage());
            Console.WriteLine(oFacade.RenderMessage());

            oFacade = new HelloWorldFacade(new WindowsServiceHelloWorldMessage());
            Console.WriteLine(oFacade.RenderMessage());

            Console.Read();
        }
Beispiel #2
0
        public void IF_Message_THEN_RenderMessageFromFacade()
        {
            IMessage       oMessage = new ConsoleHelloWorldMessage();
            IMessageFacade oFacade  = new HelloWorldFacade(oMessage);

            Assert.AreEqual(oFacade.RenderMessage(), oMessage.Render());

            oMessage = new WebApplicationHelloWorldMessage();
            oFacade  = new HelloWorldFacade(oMessage);
            Assert.AreEqual(oFacade.RenderMessage(), oMessage.Render());

            oMessage = new WindowsServiceHelloWorldMessage();
            oFacade  = new HelloWorldFacade(oMessage);
            Assert.AreEqual(oFacade.RenderMessage(), oMessage.Render());
        }