public void removeUserActionValidUA()
        {
            //Arrange
            DataBaseContext       db     = new DataBaseContext();
            IUserActionRepository uaRepo = new UserActionRepository(db);
            Guid       userID            = new Guid("7BF91B37-DC4A-E911-8259-0A64F53465D0");
            string     action            = "View_Watchlist";
            UserAction ua = uaRepo.GetUserAction(userID, action);

            //Act
            uaRepo.RemoveUserAction(ua);
            UserAction newUA = uaRepo.GetUserAction(userID, action);

            //Assert
            Assert.IsNull(newUA);
        }
Esempio n. 2
0
        public void UserActionRepository_GetUserAction_ValidUA()
        {
            //Arrange
            DataBaseContext       db     = new DataBaseContext();
            IUserActionRepository uaRepo = new UserActionRepository(db);
            Guid   userID = new Guid("44361F37-036B-E911-AA03-021598E9EC9E");
            string action = "Login";

            //Act
            UserAction ua = uaRepo.GetUserAction(userID, action);

            //Assert
            Assert.IsNotNull(ua);
        }
Esempio n. 3
0
        public void UserActionRepository_GetUserAction_InvalidUA()
        {
            //Arrange
            DataBaseContext       db     = new DataBaseContext();
            IUserActionRepository uaRepo = new UserActionRepository(db);
            Guid   userID = new Guid("7CF91B37-DC4A-E911-8259-0A64F53465D0");
            string action = "Search";

            //Act
            UserAction ua = uaRepo.GetUserAction(userID, action);

            //Assert
            Assert.IsNull(ua);
        }
Esempio n. 4
0
        public void UserActionRepository_AddUserAction_ValidUser()
        {
            //Arrange
            DataBaseContext       db     = new DataBaseContext();
            IUserActionRepository uaRepo = new UserActionRepository(db);
            Guid       userID            = new Guid("F98A70A1-056B-E911-AA03-021598E9EC9E");
            string     action            = "View_Watchlist";
            UserAction ua = new UserAction(userID, action);

            //Act
            uaRepo.AddUserAction(ua);
            UserAction newUA = uaRepo.GetUserAction(userID, action);

            //Assert
            Assert.IsNotNull(newUA);
        }