Esempio n. 1
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());
        }
Esempio n. 2
0
        public void FindById_ReturnsPaddock_ForKnownId(
            [NotNull] IPaddock expected,
            [NotNull] PaddocksRepository sut)
        {
            // Arrange
            sut.Save(expected);

            // Act
            IPaddock actual = sut.FindById(expected.Id);

            // Assert
            Assert.AreEqual(expected,
                            actual);
        }