public void removeUserActionInvalid() { //Arrange DataBaseContext db = new DataBaseContext(); IUserActionRepository uaRepo = new UserActionRepository(db); Guid userID = new Guid(); string action = "View_Watchlist"; //Act => Assert Assert.ThrowsException <ArgumentNullException>(() => uaRepo.RemoveUserAction(userID, action)); }
public void UserActionRepository_RemoveUserAction_InvalidUA() { //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 <DbUpdateConcurrencyException>(() => uaRepo.RemoveUserAction(ua)); }
public void removeUserActionValid() { //Arrange DataBaseContext db = new DataBaseContext(); IUserActionRepository uaRepo = new UserActionRepository(db); Guid userID = new Guid("7BF91B37-DC4A-E911-8259-0A64F53465D0"); string action = "View_Watchlist"; //Act uaRepo.RemoveUserAction(userID, action); UserAction removedUA = uaRepo.GetUserAction(userID, action); //Assert Assert.IsNull(removedUA); }
public void UserActionRepository_RemoveUserAction_ValidUA() { //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); //uaRepo.GetUserAction(userID, action); //Act uaRepo.RemoveUserAction(ua); UserAction newUA = uaRepo.GetUserAction(userID, action); //Assert Assert.IsNull(newUA); }