public void TestGetAllUsersSessionsOK() { ContextObl context = ContextFactory.GetMemoryContext(Guid.NewGuid().ToString()); IUserSessionRepository userSessionRepo = new UserSessionRepository(context); userSessionRepo.Add(userSession); userSessionRepo.Add(userSession2); List <UserSession> listTest = new List <UserSession>(); listTest.Add(userSession); listTest.Add(userSession2); List <UserSession> listOfUserSessions = userSessionRepo.GetAll().ToList(); CollectionAssert.AreEqual(listTest, listOfUserSessions); }
public void TestRemoveUserSessionOK() { ContextObl context = ContextFactory.GetMemoryContext(Guid.NewGuid().ToString()); IUserSessionRepository userSessionRepo = new UserSessionRepository(context); userSessionRepo.Add(userSession); userSessionRepo.Remove(userSession); userSessionRepo.GetAll(); }
public void TestGetUserSessionOK() { ContextObl context = ContextFactory.GetMemoryContext(Guid.NewGuid().ToString()); IUserSessionRepository userSessionRepo = new UserSessionRepository(context); userSessionRepo.Add(userSession); UserSession userSessionOfDb = userSessionRepo.Get(userSession.Id); Assert.AreEqual(userSession, userSessionOfDb); }
public void TestAddUserSessionOK() { ContextObl context = ContextFactory.GetMemoryContext(Guid.NewGuid().ToString()); IUserSessionRepository userSessionRepo = new UserSessionRepository(context); userSessionRepo.Add(userSession); List <UserSession> listOfUserSessions = userSessionRepo.GetAll().ToList(); Assert.AreEqual(userSession, listOfUserSessions[0]); }
public void TestGetUserSessionByToken() { ContextObl context = ContextFactory.GetMemoryContext(Guid.NewGuid().ToString()); IUserSessionRepository userSessionRepo = new UserSessionRepository(context); userSessionRepo.Add(userSession); UserSession userSessionResult = userSessionRepo.GetUserSessionByToken(userSession.Token); Assert.AreEqual(user, userSessionResult.User); }