public void GetAllRemindersShouldReturnAList() { var userId = "John"; var mockRepo = new Mock <IReminderRepository>(); mockRepo.Setup(repo => repo.GetAllRemindersByUserId(userId)).Returns(this.GetReminders()); var service = new ReminderService(mockRepo.Object); var actual = service.GetAllRemindersByUserId(userId); Assert.IsAssignableFrom <List <Reminder> >(actual); Assert.NotEmpty(actual); }
public void GetAllRemindersShouldReturnEmptyList() { string userId = "Sam"; var mockRepo = new Mock <IReminderRepository>(); mockRepo.Setup(repo => repo.GetAllRemindersByUserId(userId)).Returns(new List <Reminder>()); var service = new ReminderService(mockRepo.Object); var actual = service.GetAllRemindersByUserId(userId); Assert.IsAssignableFrom <List <Reminder> >(actual); Assert.Empty(actual); }