Esempio n. 1
0
        public void GetInvertedWord_WhenInputIsNull_ShouldReturnNull()
        {
            WordInverter classToTest = new WordInverter();

            string input = null;

            classToTest.GetInvertedWord(input);

        }
Esempio n. 2
0
        public void GetInvertedWord_WhenInputIsMacdara_ShouldReturnAradcam()
        {
            WordInverter classToTest = new WordInverter();

            var input = "Macdara";

            var expectedResult = "aradcaM";
           
            var actualResult = classToTest.GetInvertedWord(input);

            Assert.AreEqual(expectedResult, actualResult);
        }
Esempio n. 3
0
        public void OrchestrateMode_WhenGivenRetrieveMode_ShouldCallHandlerRetrieveAllWordsToConsoleOnce()
        {
            var input = UserMode.RETRIEVE;

            var moqWordService = new Mock<IWordService>();
            var moqValidator = new Validator();
            var moqWordInverter = new WordInverter();

            var target = new ModeHandler(moqWordService.Object, moqValidator, moqWordInverter);

            moqWordService.Setup(m => m.RetrieveAllWordsToConsole(It.IsAny<string>()));

            target.OrchestrateMode(input, string.Empty);

            moqWordService.Verify(m => m.RetrieveAllWordsToConsole(It.IsAny<string>()), Times.Once);
        }