ListInstallationScripts() public method

Returns a collection of installation script names with a version less than or equal to the max version.
public ListInstallationScripts ( System.Version minVersionExclusive, System.Version maxVersionInclusive ) : string[]
minVersionExclusive System.Version The min verison exclusive.
maxVersionInclusive System.Version The max version inclusive.
return string[]
コード例 #1
0
        public void ListInstallationScriptsReturnsCorrectScripts()
        {
            SqlInstaller installer = new SqlInstaller("null");
            string[] scripts = installer.ListInstallationScripts(null, new Version(1, 5, 0, 0));
            Assert.AreEqual(2, scripts.Length, "We expected to see two scripts.");
            Assert.AreEqual("Installation.01.00.00.sql", scripts[0], "Expected the initial 1.0 installation file.");
            Assert.AreEqual("Installation.01.05.00.sql", scripts[1], "Expected the bugfix 1.5 installation file.");

            scripts = installer.ListInstallationScripts(null, new Version(1, 0, 3, 0));
            Assert.AreEqual(1, scripts.Length, "We expected to see one script.");
            Assert.AreEqual("Installation.01.00.00.sql", scripts[0], "Expected the initial 1.0 installation file.");

            scripts = installer.ListInstallationScripts(null, new Version(0, 0, 3, 0));
            Assert.AreEqual(0, scripts.Length, "We expected to see no scripts.");

            scripts = installer.ListInstallationScripts(new Version(1, 1, 0, 0), new Version(1, 5, 0, 0));
            Assert.AreEqual(1, scripts.Length, "We expected to see one script.");
            Assert.AreEqual("Installation.01.05.00.sql", scripts[0], "Expected the bugfix 1.5.0 installation file.");

            scripts = installer.ListInstallationScripts(new Version(1, 1, 0, 0), new Version(1, 9, 0, 0));
            Assert.AreEqual(2, scripts.Length, "We expected to see two script.");
            Assert.AreEqual("Installation.01.09.00.sql", scripts[1], "Expected the 1.9.0 installation file.");
        }