static void Main(string[] args) { Console.WriteLine("Enter your name"); var name = Console.ReadLine(); var greeter = new Greeter(new TimeService()); var greetMsg = greeter.Greet(name); Console.WriteLine(greetMsg); Console.ReadLine(); }
static void Main(string[] args) { Console.WriteLine("Enter your name :"); var name = Console.ReadLine(); var dateTimeService = new DateTimeService(); var greeter = new Greeter(dateTimeService); Console.WriteLine(greeter.Greet(name)); Console.ReadLine(); }
static void Main(string[] args) { Console.WriteLine("Enter your name :"); var userName = Console.ReadLine(); var timeService = new TimeService(); var greeter = new Greeter(timeService); Console.WriteLine(greeter.Greet(userName)); Console.ReadLine(); }
static void Main(string[] args) { var timeService = new TimeService(); var greeter = new Greeter(timeService); Console.WriteLine("Enter the name.."); var name = Console.ReadLine(); Console.WriteLine(greeter.Greet(name)); Console.ReadLine(); }
public void Greeted_With_GoodEvening_After_12() { //var ets = new FakeTimeServiceForEvening(); var ets = new FakeTimeService(new DateTime(2014, 6, 29, 17, 0, 0)); var sut = new GreetingApp.Greeter(ets); var name = "Magesh"; var greetMsg = sut.Greet(name); Assert.AreEqual("Hi Magesh, Good Evening", greetMsg); }
public void Greeted_With_GoodMorning_Before_12() { //var mts = new FakeTimeServiceForMorning(); var mts = new FakeTimeService(new DateTime(2014, 6, 29, 10, 0, 0)); var sut = new GreetingApp.Greeter(mts); var name = "Magesh"; var greetMsg = sut.Greet(name); Assert.AreEqual("Hi Magesh, Good Morning", greetMsg); }