public void Add(Snapshot snapshot) { inMemoryStorage.Add(snapshot); if (settings.IsSessionAutoClose) { dataProvider.AddSnapshot(snapshot); } }
public void GetSession_SessionExistInMemory_SessionShouldBeReadFromMemory() { var sessionId = "SessionId2"; var session = new Session { Begin = DateTime.Now, End = DateTime.Now, Id = sessionId }; inMemoryStorage.Clear(); inMemoryStorage.Add(session); var result = subject.GetSession(sessionId); result.Should().NotBeNull(); result.Id.Should().Be(sessionId); }