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); }
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); }
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); }