public void RemovePaddock([NotNull] IPaddock paddock) { var remove = new PadockRemoveEvent { PaddockId = paddock.Id }; m_EventAggregator.PublishOnBackgroundThread(remove); }
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); }
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); }