Ejemplo n.º 1
0
        public void RegistryReadValueNotFoundNoDefaultFailure()
        {
            RegistryRead task = new RegistryRead();
            task.BuildEngine = new MockBuild();
            task.KeyName = @"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework";
            task.ValueName = "SomethingElse";
            Assert.IsTrue(task.Execute(), "Execute should have succeeded");

            Assert.AreEqual(String.Empty, task.Value);
        }
Ejemplo n.º 2
0
        public void RegistryReadKeyNotFoundNoDefaultFailure()
        {
            RegistryRead task = new RegistryRead();
            task.BuildEngine = new MockBuild();
            task.KeyName = @"HKEY_LOCAL_MACHINE\SOFTWARE\BLAH\BLAH";
            task.ValueName = "InstallRoot";
            Assert.IsFalse(task.Execute(), "Execute should have failed");

            Assert.AreEqual(null, task.Value);
        }
Ejemplo n.º 3
0
        public void RegistryReadKeyNotFoundNoDefaultFailure()
        {
            RegistryRead task = new RegistryRead();

            task.BuildEngine = new MockBuild();
            task.KeyName     = @"HKEY_LOCAL_MACHINE\SOFTWARE\BLAH\BLAH";
            task.ValueName   = "InstallRoot";
            Assert.IsFalse(task.Execute(), "Execute should have failed");

            Assert.AreEqual(null, task.Value);
        }
Ejemplo n.º 4
0
        public void RegistryReadValueNotFoundNoDefaultFailure()
        {
            RegistryRead task = new RegistryRead();

            task.BuildEngine = new MockBuild();
            task.KeyName     = @"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework";
            task.ValueName   = "SomethingElse";
            Assert.IsTrue(task.Execute(), "Execute should have succeeded");

            Assert.AreEqual(String.Empty, task.Value);
        }
Ejemplo n.º 5
0
        public void RegistryReadKeyNotFoundFailure()
        {
            RegistryRead task = new RegistryRead();
            task.BuildEngine = new MockBuild();
            task.KeyName = @"HKEY_LOCAL_MACHINE\SOFTWARE\BLAH\BLAH";
            task.ValueName = "InstallRoot";
            task.DefaultValue = "NotFound";
            Assert.IsTrue(task.Execute(), "Execute should have succeeded");

            Assert.AreEqual("NotFound", task.Value);
        }
Ejemplo n.º 6
0
        public void RegistryReadExecute()
        {
            RegistryRead task = new RegistryRead();
            task.BuildEngine = new MockBuild();
            task.KeyName = @"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework";
            task.ValueName = "InstallRoot";
            Assert.IsTrue(task.Execute(), "Execute should have succeeded");

            string expected = Environment.GetEnvironmentVariable("SystemRoot") + @"\Microsoft.NET\Framework\";
            StringAssert.AreEqualIgnoringCase(expected, task.Value);
        }
Ejemplo n.º 7
0
        public void RegistryReadKeyNotFoundFailure()
        {
            RegistryRead task = new RegistryRead();

            task.BuildEngine  = new MockBuild();
            task.KeyName      = @"HKEY_LOCAL_MACHINE\SOFTWARE\BLAH\BLAH";
            task.ValueName    = "InstallRoot";
            task.DefaultValue = "NotFound";
            Assert.IsTrue(task.Execute(), "Execute should have succeeded");

            Assert.AreEqual("NotFound", task.Value);
        }
Ejemplo n.º 8
0
        public void RegistryReadExecute()
        {
            RegistryRead task = new RegistryRead();

            task.BuildEngine = new MockBuild();
            task.KeyName     = @"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework";
            task.ValueName   = "InstallRoot";
            Assert.IsTrue(task.Execute(), "Execute should have succeeded");

            string expected = Environment.GetEnvironmentVariable("SystemRoot") + @"\Microsoft.NET\Framework\";

            StringAssert.AreEqualIgnoringCase(expected, task.Value);
        }