Ejemplo n.º 1
0
        public void LoadsDependeciesList()
        {
            DependenciesSection section = TestHelper.GetDependenciesSection();
            var builder = new DependenciesInfoBuilder(null);

            DependenciesInfo info = builder.BuildDependenciesInfo(section, 200);

            Assert.AreEqual(2, info.Dependencies.Count);
            Assert.AreEqual("MinimumRequirement", info.Dependencies[0].Title);
            Assert.AreEqual(true, info.Dependencies[0].Enabled);
            Assert.AreEqual("This might be handy in all cases", info.Dependencies[0].Explanation);
            Assert.AreEqual("http://www.microsoft.com", info.Dependencies[0].DownloadUrl);
            Assert.IsTrue(string.IsNullOrEmpty(info.Dependencies[0].InfoUrl));
            Assert.IsTrue(string.IsNullOrEmpty(info.Dependencies[0].ScriptName));
            Assert.AreEqual("Optional", info.Dependencies[0].Category);
            Assert.AreEqual("Reg2", info.Dependencies[0].Check);
            Assert.AreEqual("Microsoft Visual Studio 2005", info.Dependencies[1].Title);
            Assert.AreEqual(true, info.Dependencies[1].Enabled);
            Assert.AreEqual("In order to use the Guidance Package, you will need to install Visual Studio 2005", info.Dependencies[1].Explanation);
            Assert.AreEqual("http://www.microsoft.com/VisualStudio", info.Dependencies[1].DownloadUrl);
            Assert.IsTrue(string.IsNullOrEmpty(info.Dependencies[1].InfoUrl));
            Assert.IsTrue(string.IsNullOrEmpty(info.Dependencies[1].ScriptName));
            Assert.AreEqual("MyCategory", info.Dependencies[1].Category);
            Assert.AreEqual("(Reg1 || Soft1) && Exp12", info.Dependencies[1].Check);
        }
Ejemplo n.º 2
0
        public void ChecksMinimumBuildNumber()
        {
            DependenciesSection section = TestHelper.GetDependenciesSection();

            var builder = new DependenciesInfoBuilder(null);

            builder.BuildDependenciesInfo(section, 20);

            try
            {
                builder.BuildDependenciesInfo(section, 5);
                Assert.Fail("Does not check for minimum build.");
            }
            catch (NotSupportedOperatingSystemException)
            {
            }
        }
Ejemplo n.º 3
0
        public void CommonChecksAreIncluded()
        {
            DependenciesSection section = TestHelper.GetDependenciesSection();
            var builder = new DependenciesInfoBuilder(null);

            DependenciesInfo info = builder.BuildDependenciesInfo(section, 300);

            Assert.AreEqual(6, TestHelper.Count(info.EvaluationContext.GetCheckNames()));
        }
Ejemplo n.º 4
0
        public void CustomOSChecksOverrideCommonChecks()
        {
            DependenciesSection section = TestHelper.GetDependenciesSection();
            var builder = new DependenciesInfoBuilder(null);

            DependenciesInfo info = builder.BuildDependenciesInfo(section, 100);

            Assert.AreEqual(7, TestHelper.Count(info.EvaluationContext.GetCheckNames()));
        }
Ejemplo n.º 5
0
        public void FindsExactMatch()
        {
            DependenciesSection section = TestHelper.GetDependenciesSection();
            var builder = new DependenciesInfoBuilder(null);

            DependenciesInfo info = builder.BuildDependenciesInfo(section, 100);

            Assert.IsNotNull(info);
            Assert.AreEqual(100, info.CompatibleOsBuild);
        }