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

            int reminderId = 5;

            User mockUser = null;

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

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

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

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

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

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

            Reminder mockReminder = mockReminderBusiness.FetchReminderById(reminderId, mockUser);

            Assert.AreEqual(reminderId, mockReminder.ReminderId, "Wrong reminder was fetched!");
        }