Пример #1
0
        public void RemoveSnapshot_SessionIdAndSnapshotIdProvided_SnapshotShouldBeRemovedFromMemoryAndFile()
        {
            var snapshot = new Snapshot
            {
                Id = "SnapshotId"
            };

            var session = new Session
            {
                Id = "SessionId"
            };

            session.AddSnapshot(snapshot);
            inMemoryStorage.Clear();
            inMemoryStorage.Add(session);
            dataProvider.AddSnapshot(snapshot);

            subject.RemoveSnapshot(snapshot.SessionId, snapshot.Id);

            var resultFromMemory = inMemoryStorage.GetSnapshotSave(snapshot.SessionId, snapshot.Id);

            resultFromMemory.IsSuccessful.Should().BeFalse();

            var resultFromFile = dataProvider.GetSnapshotSave(snapshot.SessionId, snapshot.Id);

            resultFromFile.IsSuccessful.Should().BeFalse();
        }