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