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 ModelNotNull_ShouldAddToRepository()
        {
            // arrange
            var sut   = new AdService(AdRepositoryMock.Object);
            var model = new AddAdModel
            {
                Subject      = "subject",
                Body         = "body",
                EmailAddress = "email",
                PriceSek     = 500
            };

            // act
            sut.Add(model);
            // assert
            AdRepositoryMock.Verify(m => m.Add(It.IsAny <Ad>()));
        }