public void TestAddNullReminderToTheDatabase() { ReminderBusiness mockReminderBusiness = new ReminderBusiness(_mockContext.Object); Reminder mockReminder = null; Assert.Catch(() => mockReminderBusiness.AddReminder(mockReminder), "Null reminder added to the database!"); }
public void TestAddNewReminderToTheDatabase() { ReminderBusiness mockReminderBusiness = new ReminderBusiness(_mockContext.Object); Reminder mockReminder = new Reminder() { ReminderId = 3, DueTime = DateTime.Now, Name = "name", UserId = 1 }; mockReminderBusiness.AddReminder(mockReminder); Assert.Contains(mockReminder, mockReminderBusiness.GetPODbContext.Reminders.ToList(), "Reminder not added properly!"); }