public void GetWords_WithStringParameter_ReturnsWordsThatStartWithStringParameter() { _wordsRepository.GetWords().Returns(new List <Word> { new Word { Id = 1, Text = "Labas" }, new Word { Id = 2, Text = "Laibas" }, new Word { Id = 3, Text = "Lalala" }, new Word { Id = 4, Text = "Albas" }, }); var matchingWordsResult = _wordsService.GetWords("la"); _wordsRepository.Received().GetWords(); _wordsRepository.ReceivedCalls().ToList().Count.ShouldBe(1); matchingWordsResult.ShouldNotBeEmpty(); matchingWordsResult.First().Text.ShouldBe("Labas"); matchingWordsResult.Last().Text.ShouldBe("Lalala"); }