public void WhenResponseHasNoDefinitionThenResponseShouldBeEmptyString() { var word = "pig"; var fileHelper = Substitute.For <IFileHelper>(); fileHelper .ReadDictionary(Arg.Any <string>()) .Returns(_dictionary); var wordDefinitionHelper = new WordDefinitionHelper(fileHelper); var definitionResponse = wordDefinitionHelper.GetDefinitionForWord(word); definitionResponse.Should().Be(""); }
public void WhenResponseOnlyHasPermanentDefinitionThenResponseShouldBePermanentDefinition() { var word = "frog"; var fileHelper = Substitute.For <IFileHelper>(); fileHelper .ReadDictionary(Arg.Any <string>()) .Returns(_dictionary); var wordDefinitionHelper = new WordDefinitionHelper(fileHelper); var definitionResponse = wordDefinitionHelper.GetDefinitionForWord(word); definitionResponse.Should().Be("Irresistible kings of the pond who princesses can't resist"); }
public void WhenResponseOnlyHasTemporaryDefinitionThenResponseShouldBeTemporaryDefinition() { var word = "cow"; var fileHelper = Substitute.For <IFileHelper>(); fileHelper .ReadDictionary(Arg.Any <string>()) .Returns(_dictionary); var wordDefinitionHelper = new WordDefinitionHelper(fileHelper); var definitionResponse = wordDefinitionHelper.GetDefinitionForWord(word); definitionResponse.Should().Be("Makes different flavours of milk depending on diet"); }
public void WhenWordHasBothPermanentAndTemporaryDefinitionsResponseShouldBePermanent() { var word = "sheep"; var fileHelper = Substitute.For <IFileHelper>(); fileHelper .ReadDictionary(Arg.Any <string>()) .Returns(_dictionary); var wordDefinitionHelper = new WordDefinitionHelper(fileHelper); var definitionResponse = wordDefinitionHelper.GetDefinitionForWord(word); definitionResponse.Should().Be("Farm animals that eat grass and have wool coats"); }