public void Find_DoesNotReturnNull(TagQueryService sut) { // When var result = sut.Find(); // Then Assert.NotNull(result); }
public void Find_EagerLoadsAssociatedTags( [Frozen]Mock<IRepository<Tag>> repository, TagQueryService sut) { // When sut.Find(); // Then repository.Verify(m => m.Find("Posts")); }
public void Find_WithNoItems_ReturnsEmptySequence( [Frozen]Mock<IRepository<Tag>> repository, TagQueryService sut) { // Given repository .Setup(r => r.Find(It.IsAny<string>())) .Returns(new Tag[0]); // When var result = sut.Find(); // Then Assert.False(result.Any()); }
public void Find_WithSomeItems_ReturnsSameNumberOfResults( [Frozen]Mock<IRepository<Tag>> repository, IEnumerable<Tag> items, TagQueryService sut) { // Given repository .Setup(s => s.Find(It.IsAny<string[]>())) .Returns(items); // When var result = sut.Find(); // Then Assert.Equal(items.Count(), result.Count()); }