Ejemplo n.º 1
0
        public void TestDeleteNonExistentReminderFromTheDatabase()
        {
            ReminderBusiness mockReminderBusiness = new ReminderBusiness(_mockContext.Object);
            UserBusiness     mockUserBusiness     = new UserBusiness(_mockContext.Object);

            int    reminderId   = 3;
            string userName     = "******";
            string passwordHash = "passwordHash";

            User mockUser = mockUserBusiness.FetchUser(userName, passwordHash);

            Assert.Catch(() => mockReminderBusiness.RemoveReminder(reminderId, mockUser), "Non existent reminder was deleted!");
        }
Ejemplo n.º 2
0
        public void TestDeleteReminderFromTheDatabase()
        {
            ReminderBusiness mockReminderBusiness = new ReminderBusiness(_mockContext.Object);
            UserBusiness     mockUserBusiness     = new UserBusiness(_mockContext.Object);

            int    reminderId   = 1;
            string userName     = "******";
            string passwordHash = "passwordHash";

            int oldCount = mockReminderBusiness.GetPODbContext.Reminders.ToList().Count();

            User mockUser = mockUserBusiness.FetchUser(userName, passwordHash);

            mockReminderBusiness.RemoveReminder(reminderId, mockUser);

            Assert.Less(mockReminderBusiness.GetPODbContext.Reminders.ToList().Count(), oldCount, "Reminder not deleted properly!");
        }