public void GetSession_Inexistent_Arg_Returnsnull() { Site.CreateUser("pinco", "pippo.123"); var session = Site.Login("pinco", "pippo.123"); var sessionId = session.Id; session.Logout(); Site.CleanupSessions(); var inexistentSession = Site.GetSession(sessionId); Assert.IsNull(inexistentSession); }
public void CleanupSessions_TwoSites() { var now = AlarmClock.Object.Now; CreateAndLogin_User(Site1, "usersite1", "pwsite1"); CreateAndLogin_User(Site2, "usersite2", "pwsite2"); AlarmClock.Setup(ac => ac.Now).Returns(now.AddSeconds(SessionExpirationTinInSeconds + 1)); Site1.CleanupSessions(); Assert.That(Site2.GetSessions(), Is.Not.Empty); }