From b2e3a1e2e311a9350e35b9b94df3bf61bcfcbe01 Mon Sep 17 00:00:00 2001 From: Andrew Schwartzmeyer Date: Mon, 6 Jul 2015 12:46:38 -0700 Subject: [PATCH] Add unit test for HasRegistrySupport() The use of the function in RegistryProvider cannot be tested without a mock of a PowerShell cmdlet context. --- src/ps_test/ps_test.cs | 1 + src/ps_test/test_CorePsPlatform.cs | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/src/ps_test/ps_test.cs b/src/ps_test/ps_test.cs index 438f6170e..d42d7a0e5 100644 --- a/src/ps_test/ps_test.cs +++ b/src/ps_test/ps_test.cs @@ -14,6 +14,7 @@ namespace PSTests PlatformTests.TestHasAmsi(); PlatformTests.TestUsesCodeSignedAssemblies(); PlatformTests.TestHasDriveAutoMounting(); + PlatformTests.TestHasRegistrySupport(); PSTypeExtensionsTests.TestIsComObject(); diff --git a/src/ps_test/test_CorePsPlatform.cs b/src/ps_test/test_CorePsPlatform.cs index a5a2b724e..6baf895c4 100644 --- a/src/ps_test/test_CorePsPlatform.cs +++ b/src/ps_test/test_CorePsPlatform.cs @@ -30,5 +30,10 @@ namespace PSTests { Assert.False(Platform.HasDriveAutoMounting()); } + + public static void TestHasRegistrySupport() + { + Assert.False(Platform.HasRegistrySupport()); + } } }