//TODO: write methods to create default useractions public void AddDefaultUserActions(Guid userID) { //add any new actions for users here List <UserAction> actions = new List <UserAction>() { new UserAction(userID, Actions.SEARCH), new UserAction(userID, Actions.WISHLIST), new UserAction(userID, Actions.DELETESELF) }; foreach (UserAction ua in actions) { uaRepo.AddUserAction(ua); } }
//TODO: write methods to create default useractions public void AddDefaultUserActions(Guid userID) { //add any new actions for users here List <UserAction> actions = new List <UserAction>() { new UserAction(userID, "Search"), new UserAction(userID, "Watchlist"), new UserAction(userID, "SeeData"), new UserAction(userID, "DeleteSelf") }; foreach (UserAction ua in actions) { uaRepo.AddUserAction(ua); } }
public void UserActionRepository_AddUserAction_InvalidUser() { //Arrange DataBaseContext db = new DataBaseContext(); IUserActionRepository uaRepo = new UserActionRepository(db); Guid userID = new Guid(); string action = "View_Watchlist"; UserAction ua = new UserAction(userID, action); //Act => Assert Assert.ThrowsException <DbUpdateException>(() => uaRepo.AddUserAction(ua)); }
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); }
public void addUserActionValidUser() { //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 = new UserAction(userID, action); //Act uaRepo.AddUserAction(ua); UserAction newUA = uaRepo.GetUserAction(userID, action); //Assert Assert.IsNotNull(newUA); }