2015-06-12 00:15:45 +02:00
|
|
|
using Xunit;
|
|
|
|
using System;
|
|
|
|
using System.Management.Automation;
|
|
|
|
|
|
|
|
namespace PSTests
|
|
|
|
{
|
2016-03-18 02:15:39 +01:00
|
|
|
[Collection("AssemblyLoadContext")]
|
2015-06-12 00:15:45 +02:00
|
|
|
public static class SecuritySupportTests
|
|
|
|
{
|
2015-07-21 00:31:03 +02:00
|
|
|
[Fact]
|
2015-06-12 00:15:45 +02:00
|
|
|
public static void TestScanContent()
|
|
|
|
{
|
|
|
|
Assert.Equal(AmsiUtils.ScanContent("", ""), AmsiUtils.AmsiNativeMethods.AMSI_RESULT.AMSI_RESULT_NOT_DETECTED);
|
|
|
|
}
|
|
|
|
|
2015-07-21 00:31:03 +02:00
|
|
|
[Fact]
|
2015-06-12 00:15:45 +02:00
|
|
|
public static void TestCurrentDomain_ProcessExit()
|
|
|
|
{
|
2015-09-04 01:04:12 +02:00
|
|
|
Assert.Throws<PlatformNotSupportedException>(delegate {
|
|
|
|
AmsiUtils.CurrentDomain_ProcessExit(null, EventArgs.Empty);
|
|
|
|
});
|
2015-06-12 00:15:45 +02:00
|
|
|
}
|
|
|
|
|
2015-07-21 00:31:03 +02:00
|
|
|
[Fact]
|
2015-06-12 00:15:45 +02:00
|
|
|
public static void TestCloseSession()
|
|
|
|
{
|
|
|
|
AmsiUtils.CloseSession();
|
|
|
|
}
|
|
|
|
|
2015-07-21 00:31:03 +02:00
|
|
|
[Fact]
|
2015-06-12 00:15:45 +02:00
|
|
|
public static void TestUninitialize()
|
|
|
|
{
|
|
|
|
AmsiUtils.Uninitialize();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|