public void AboveZeroId_ShouldAddToRepository() { var sut = new AdService(AdRepositoryMock.Object); sut.Delete(1); AdRepositoryMock.Verify(m => m.Delete(It.IsAny <int>())); }
public void NegativeId_ShouldThrow() { var sut = new AdService(AdRepositoryMock.Object); void Act() => sut.Delete(-1); Assert.Throws <ArgumentException>(Act); }
public void Delete(int id) { service.Delete(id, UserId); }