public void GetInvertedWord_WhenInputIsNull_ShouldReturnNull() { WordInverter classToTest = new WordInverter(); string input = null; classToTest.GetInvertedWord(input); }
public void GetInvertedWord_WhenInputIsMacdara_ShouldReturnAradcam() { WordInverter classToTest = new WordInverter(); var input = "Macdara"; var expectedResult = "aradcaM"; var actualResult = classToTest.GetInvertedWord(input); Assert.AreEqual(expectedResult, actualResult); }
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); }