예제 #1
0
        public void Should_return_empty_timeOfDay_when_provided_a_non_registered_timeOfDay()
        {
            //arrange
            var          input = new string[] { "evening" };
            var          dishesMenuServiceFake = A.Fake <IDishesMenuService>();
            var          inputProcessorService = new InputProcessorService(dishesMenuServiceFake);
            const string morningText           = default(string);

            //act
            var timeOfDay = inputProcessorService.ParseTimeOfDay(input);

            //assert
            timeOfDay.Should().Be(morningText, "Because will not be found, if the value don't exists it's considered an error");
        }
예제 #2
0
        public void Should_return_a_normalized_timeOfDay_when_provided_a_correct_string()
        {
            //arrange
            var input = new string[] { "MorNing" };
            var dishesMenuServiceFake = A.Fake <IDishesMenuService>();
            var inputProcessorService = new InputProcessorService(dishesMenuServiceFake);
            var morningText           = TimeOfDayType.Morning.ToString();

            //act
            var timeOfDay = inputProcessorService.ParseTimeOfDay(input);

            //assert
            timeOfDay.Should().Be(morningText, "Because will be found, no matter the case, if the value exists on TimeOfDayType (ex: Morning, Night)");
        }