Exemplo n.º 1
0
        public void GapInRevisionsDoesNotThrow()
        {
            List<string> filePaths = new List<string>()
            {
                @"C:\db.0000.sql",
                @"C:\db.02.SQL"
            };

            SqlStack stack = new SqlStack(filePaths);
            Assert.That(stack.ScriptsByRevision.ContainsKey(1), Is.False);
            Assert.That(stack.ScriptsByRevision[2], Is.EqualTo(@"C:\db.02.SQL"));
        }
Exemplo n.º 2
0
        public void DifferentExtensionNotPickedUp()
        {
            List<string> filePaths = new List<string>()
            {
                @"C:\db.0000.sql",
                @"C:\db.0001.comment.sqlx",
                @"C:\db.02.SQL"
            };

            SqlStack stack = new SqlStack(filePaths);
            Assert.That(stack.ScriptsByRevision[0], Is.EqualTo(@"C:\db.0000.sql"));
            Assert.That(stack.ScriptsByRevision[2], Is.EqualTo(@"C:\db.02.SQL"));
            Assert.That(stack.ScriptsByRevision.Count, Is.EqualTo(2));
        }
Exemplo n.º 3
0
        public void TestHappyPath()
        {
            List<string> filePaths = new List<string>()
            {
                @"C:\db.0000.sql",
                @"C:\db.0001.comment.sql",
                @"C:\db.02.SQL"
            };

            SqlStack stack = new SqlStack(filePaths);
            Assert.That(stack.MasterDatabaseName, Is.EqualTo("db"));
            Assert.That(stack.ScriptsByRevision[0], Is.EqualTo(@"C:\db.0000.sql"));
            Assert.That(stack.ScriptsByRevision[1], Is.EqualTo(@"C:\db.0001.comment.sql"));
            Assert.That(stack.ScriptsByRevision[2], Is.EqualTo(@"C:\db.02.SQL"));
            Assert.That(stack.ScriptsByRevision.Count, Is.EqualTo(3));
        }