Example #1
0
        public void When_Greeted_After_12_Greets_GoodAfternoon()
        {
            //Arrange
            var fakeDateTimeServiceForAfternoon = new FakeDateTimeServiceForAfternoon();
            var greeter         = new Greeter(fakeDateTimeServiceForAfternoon);
            var name            = "Magesh";
            var expectedMessage = "Hi Magesh, Good Afternoon!!";

            //Act
            greeter.Name = name;
            var message = greeter.Greet();

            //Assert
            Assert.AreEqual(expectedMessage, message);
        }
Example #2
0
        public void When_Greeted_In_The_Afternoon_Returns_AfternoonView()
        {
            //Arrage
            var fakeGreeter = new FakeGreeter();
            var fakeDateTimeServiceForAfternoon = new FakeDateTimeServiceForAfternoon();
            var controller       = new GreeterController(fakeGreeter, fakeDateTimeServiceForAfternoon);
            var expectedViewName = "AfternoonView";
            var greetInput       = new GreetInput();

            //Act
            var result = controller.Greet(greetInput);

            //Assert
            Assert.AreEqual(expectedViewName, result.ViewName);
        }