diff --git a/src/monad b/src/monad index fbfb5a555..3ca3331f4 160000 --- a/src/monad +++ b/src/monad @@ -1 +1 @@ -Subproject commit fbfb5a555ae4fa6d465eba59fff6edc281cdd536 +Subproject commit 3ca3331f4bba19ed57595c173264a267878e0b65 diff --git a/src/ps_test/ps_test.cs b/src/ps_test/ps_test.cs index 3ae9a1b25..9f0b80825 100644 --- a/src/ps_test/ps_test.cs +++ b/src/ps_test/ps_test.cs @@ -12,6 +12,7 @@ namespace PSTests PlatformTests.TestIsLinux(); PlatformTests.TestHasCom(); PlatformTests.TestHasAmsi(); + PlatformTests.TestUsesCodeSignedAssemblies(); PSTypeExtensionsTests.TestIsComObject(); @@ -20,6 +21,10 @@ namespace PSTests SecuritySupportTests.TestCloseSession(); SecuritySupportTests.TestUninitialize(); + MshSnapinInfoTests mshSnapinInfoTests = new MshSnapinInfoTests(); + mshSnapinInfoTests.TestReadRegistryInfo(); + mshSnapinInfoTests.TestReadCoreEngineSnapIn(); + Console.WriteLine("Finished running tests"); } } diff --git a/src/ps_test/test_CorePsPlatform.cs b/src/ps_test/test_CorePsPlatform.cs index ff18ff6cf..dac4d3b3a 100644 --- a/src/ps_test/test_CorePsPlatform.cs +++ b/src/ps_test/test_CorePsPlatform.cs @@ -20,5 +20,10 @@ namespace PSTests { Assert.False(Platform.HasAmsi()); } + + public static void TestUsesCodeSignedAssemblies() + { + Assert.False(Platform.UsesCodeSignedAssemblies()); + } } } diff --git a/src/ps_test/test_MshSnapinInfo.cs b/src/ps_test/test_MshSnapinInfo.cs new file mode 100644 index 000000000..45499dd4a --- /dev/null +++ b/src/ps_test/test_MshSnapinInfo.cs @@ -0,0 +1,25 @@ +using Xunit; +using System; +using System.Management.Automation; + +namespace PSTests +{ + // Not static because a test requires non-const variables + public class MshSnapinInfoTests + { + // Test that it does not throw an exception + public void TestReadRegistryInfo() + { + Version someVersion = null; + string someString = null; + PSSnapInReader.ReadRegistryInfo(out someVersion, out someString, out someString, out someString, out someString, out someVersion); + } + + // PublicKeyToken is null on Linux + public void TestReadCoreEngineSnapIn() + { + PSSnapInInfo pSSnapInInfo = PSSnapInReader.ReadCoreEngineSnapIn(); + Assert.Contains("PublicKeyToken=null", pSSnapInInfo.AssemblyName); + } + } +}