public void Nonquiesceable_NotQuiesced() { // Arrange var repoMock = new Mock <IRepository <NonquiesceableEntity> >(); var quiescingRepo = new QuiescingRepository <NonquiesceableEntity>(repoMock.Object); var entity = new NonquiesceableEntity(); // Act quiescingRepo.Update(entity); // Assert repoMock.Verify(x => x.Update(It.Is((NonquiesceableEntity e) => !e.IsQuiesced)), Times.Once); entity.IsQuiesced.Should().BeFalse(); }
public void Add_Quiesces() { // Arrange var repoMock = new Mock <IRepository <QuiesceableEntity> >(); var quiescingRepo = new QuiescingRepository <QuiesceableEntity>(repoMock.Object); var entity = new QuiesceableEntity(); // Act quiescingRepo.Add(entity); // Assert repoMock.Verify(x => x.Add(It.Is((QuiesceableEntity e) => e.IsQuiesced)), Times.Once); entity.IsQuiesced.Should().BeTrue(); }