Example #1
0
        public void AboveZeroId_ShouldAddToRepository()
        {
            var sut = new AdService(AdRepositoryMock.Object);

            sut.Delete(1);
            AdRepositoryMock.Verify(m => m.Delete(It.IsAny <int>()));
        }
Example #2
0
        public void NegativeId_ShouldThrow()
        {
            var sut = new AdService(AdRepositoryMock.Object);

            void Act() => sut.Delete(-1);

            Assert.Throws <ArgumentException>(Act);
        }
Example #3
0
 public void Delete(int id)
 {
     service.Delete(id, UserId);
 }