예제 #1
0
        public void FindByFarmId_ReturnsEmpty_ForUnknownFarmId(
            [NotNull] PaddocksRepository sut)
        {
            // Arrange
            // Act
            IQueryable <IPaddock> actual = sut.FindByFarmId(Guid.Empty);

            // Assert
            Assert.AreEqual(0,
                            actual.Count());
        }
예제 #2
0
        public void FindByFarmId_ReturnsPaddocks_ForKnownFarmId(
            [NotNull] Paddock one,
            [NotNull] Paddock two,
            Guid farmId,
            [NotNull] PaddocksRepository sut)
        {
            // Arrange
            one.FarmId = farmId;
            two.FarmId = farmId;

            sut.Save(one);
            sut.Save(two);

            // Act
            IQueryable <IPaddock> actual = sut.FindByFarmId(farmId);

            // Assert
            Assert.AreEqual(2,
                            actual.Count());
        }