Exemplo n.º 1
0
        public void TestAddNullReminderToTheDatabase()
        {
            ReminderBusiness mockReminderBusiness = new ReminderBusiness(_mockContext.Object);

            Reminder mockReminder = null;

            Assert.Catch(() => mockReminderBusiness.AddReminder(mockReminder), "Null reminder added to the database!");
        }
Exemplo n.º 2
0
        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!");
        }