Exemplo n.º 1
0
        public void DeleteReminderShouldReturnTrue()
        {
            var mockRepo = new Mock <IReminderRepository>();
            int Id       = 202;

            mockRepo.Setup(repo => repo.DeleteReminder(Id)).Returns(true);
            var service = new API.Service.ReminderService(mockRepo.Object);

            var actual = service.DeleteReminder(Id);

            Assert.True(actual);
        }
Exemplo n.º 2
0
        public void DeleteReminderShouldThrowException()
        {
            var mockRepo = new Mock <IReminderRepository>();
            int Id       = 205;

            mockRepo.Setup(repo => repo.DeleteReminder(Id)).Returns(false);
            var service = new API.Service.ReminderService(mockRepo.Object);

            var actual = Assert.Throws <ReminderNotFoundException>(() => service.DeleteReminder(Id));

            Assert.Equal("This reminder id not found", actual.Message);
        }