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); }
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); }
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); }
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); }