Example #1
0
        public void Sync_with_create_flag_should_create_initial_revision()
        {
            var database = new DatabaseFake {
                VerifyConnectionValue = false
            };
            var target = new Target(new ServerFake(), database);

            target.AddRevision(new Revision("create", (s, d) => database.VerifyConnectionValue = true));
            target.Sync();

            Assert.That(database.GetRevision(), Is.EqualTo("create"));
        }
Example #2
0
        public void Sync_should_set_revision_after_successful_apply()
        {
            var database = new DatabaseFake {
                VerifyConnectionValue = true
            };

            database.SetRevision("Current");
            var target = new Target(new ServerFake(), database);

            target.AddRevision(new Revision("First", null));
            target.AddRevision(new Revision("Current", null));
            target.AddRevision(new Revision("After", (s, d) => d = d));

            target.Sync(false);

            Assert.That(database.GetRevision(), Is.EqualTo("After"));
        }