Esempio n. 1
0
        public void TestRemoveAllNullUserRemindersFromTheDatabase()
        {
            ReminderBusiness mockReminderBusiness = new ReminderBusiness(_mockContext.Object);

            User mockUser = null;

            Assert.Catch(() => mockReminderBusiness.RemoveAllReminders(mockUser), "All null user reminder were removed!");
        }
Esempio n. 2
0
        public void TestRemoveAllUserRemindersFromTheDatabase()
        {
            ReminderBusiness mockReminderBusiness = new ReminderBusiness(_mockContext.Object);
            UserBusiness     mockUserBusiness     = new UserBusiness(_mockContext.Object);

            string userName     = "******";
            string passwordHash = "passwordHash";

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

            mockReminderBusiness.RemoveAllReminders(mockUser);

            int count         = mockReminderBusiness.GetPODbContext.Reminders.Where(x => x.UserId == mockUser.UserId).ToList().Count();
            int expectedCount = 0;

            Assert.AreEqual(expectedCount, count, "Not all user reminders were removed!");
        }