예제 #1
0
        public void Ex1()
        {
            string    environment = "production";
            ILoggable log;

            if (environment == "production")
            {
                log = new Logger();
            }
            else
            {
                log = new FakeLogger();
            }

            var x = new ClientX();

            x.Run(log);

            var y = new ClientY();

            y.Run(log);

            CollectionAssert.AreEqual(new[] {
                "New Logger",

                "ClientX",
                "Logger:1",
                "Logger:2",

                "ClientY",
                "Logger:3",
                "Logger:4",
            }, _actions);
        }
예제 #2
0
        public void Ex1()
        {
            var x = new ClientX();

            x.Run("production");

            var y = new ClientY();

            y.Run("production");

            CollectionAssert.AreEqual(new[] {
                "Enter ClientX",
                "Logger:ClientX",

                "Enter ClientY",
                "Logger:ClientY",
            }, _actions);
        }
예제 #3
0
        public void Ex1()
        {
            string environment = "production";
            var    x           = new ClientX();

            x.Run(environment);

            var y = new ClientY();

            y.Run(environment);

            CollectionAssert.AreEqual(new[] {
                "New Logger",

                "ClientX",
                "Logger:1",
                "Logger:2",

                "ClientY",
                "Logger:3",
                "Logger:4",
            }, _actions);
        }