public void BacksUpMigratedDocumentBeforeMigration()
        {
            var id = NewId();

            Document <Entity>();

            store.Initialize();

            using (var session = store.OpenSession())
            {
                session.Store(new Entity {
                    Id = id, Property = "Asger"
                });
                session.SaveChanges();
            }

            Reset();
            Document <Entity>();
            UseMigrations(new InlineMigration(1, new ChangeDocumentAsJObject <Entity>(x => { x["Property"] += "1"; })));

            var backupWriter = new FakeBackupWriter();

            UseBackupWriter(backupWriter);

            store.Initialize();

            backupWriter.Files.Count.ShouldBe(1);
            backupWriter.Files[$"HybridDb.Tests.HybridDbTests+Entity_{id}_0.bak"]
            .ShouldBe(configuration.Serializer.Serialize(new Entity {
                Id = id, Property = "Asger"
            }));
        }
        public void BacksUpMigratedDocumentBeforeMigration()
        {
            var id = NewId();
            Document<Entity>();

            store.Initialize();

            using (var session = store.OpenSession())
            {
                session.Store(new Entity { Id = id, Property = "Asger" });
                session.SaveChanges();
            }

            Reset();
            Document<Entity>();
            UseMigrations(new InlineMigration(1, new ChangeDocumentAsJObject<Entity>(x => { x["Property"] += "1"; })));

            var backupWriter = new FakeBackupWriter();
            UseBackupWriter(backupWriter);

            store.Initialize();

            backupWriter.Files.Count.ShouldBe(1);
            backupWriter.Files[$"HybridDb.Tests.HybridDbTests+Entity_{id}_0.bak"]
                .ShouldBe(configuration.Serializer.Serialize(new Entity { Id = id, Property = "Asger" }));
        }