public void RemovePaddock([NotNull] IPaddock paddock)
        {
            var remove = new PadockRemoveEvent
            {
                PaddockId = paddock.Id
            };

            m_EventAggregator.PublishOnBackgroundThread(remove);
        }
예제 #2
0
        public void FindById_ReturnsNull_ForUnknownId(
            [NotNull] PaddocksRepository sut)
        {
            // Arrange
            // Act
            IPaddock actual = sut.FindById(Guid.Empty);

            // Assert
            Assert.Null(actual);
        }
        public void Handle([NotNull] PadockRemoveEvent message)
        {
            IPaddock paddock = m_PaddocksRepository.FindById(message.PaddockId);

            if (paddock == null)
            {
                return;
            }

            m_PaddocksRepository.Remove(paddock);

            PublishPaddocksChangedEvent(paddock.FarmId);
        }
예제 #4
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);
        }