Exemple #1
0
        public void given_package_xml_with_0_version_when_query_versions_should_return_empty_dictionary()
        {
            const string xml = "<package name=\"SQLServer\"></package>";

            var sut = new Package(xml);

            Assert.AreEqual(0, sut.Versions.Count);
        }
Exemple #2
0
        public void given_package_xml_when_query_name_should_return_correct_name()
        {
            const string xml = "<package name=\"SQLServer\"></package>";

            var sut = new Package(xml);

            Assert.AreEqual("SQLServer", sut.Name);
        }
Exemple #3
0
        public void given_package_xml_with_1_version_when_query_the_version_should_return_not_null()
        {
            const string xml = "<package name=\"SQLServer\"><version value=\"11\"></version></package>";

            var sut = new Package(xml);

            Assert.AreEqual(1, sut.Versions.Count);
            Assert.IsNotNull(sut.Versions["11"]);
        }
Exemple #4
0
 private void FindFile()
 {
     string script = GetFindScriptPath(Package, GetSearchPath());
     var package = new Package(File.ReadAllText(script));
     try
     {
         var result = package.FindFile(FileName, Version, Recursive);
         Project.Properties[FileName] = result.Path;
         Project.Properties[FileName + ".version"] = result.Version;
         Project.Properties[FileName + ".found"] = true.ToString();
     }
     catch (FindException)
     {
         Project.Properties[FileName + ".found"] = false.ToString();
         throw;
     }
 }
Exemple #5
0
 private void FindPackage()
 {
     string script = GetFindScriptPath(Package, GetSearchPath());
     var package = new Package(File.ReadAllText(script));
     try
     {
         var result = package.Find(Version);
         Project.Properties[Package] = result.Path;
         Project.Properties[Package + ".version"] = result.Version;
         Project.Properties[Package + ".found"] = true.ToString();
         Project.Log(Level.Info, "Found: version " + result.Version);
         Project.Log(Level.Info, result.Path);
     }
     catch (FindException)
     {
         Project.Properties[Package + ".found"] = false.ToString();
         throw;
     }
 }