mirror of
https://github.com/PowerShell/PowerShell
synced 2026-06-08 12:12:50 +00:00
Add unit tests for HasCom() and IsComObject()
Added using declartion for clarity to test_CorePsPlatform and made test function naming scheme consistent. Update monad submodule with feature query.
This commit is contained in:
+1
-1
@@ -113,7 +113,7 @@ dotnetlibs/xunit.console.exe: $(MONAD_EXT)/xunit/xunit.console.netcore.exe
|
||||
cp -f $^ $@
|
||||
|
||||
TEST_FOLDER=../src/ps_test
|
||||
TEST_SRCS=$(addprefix $(TEST_FOLDER)/, test_CorePsPlatform.cs)
|
||||
TEST_SRCS=$(addprefix $(TEST_FOLDER)/, test_CorePsPlatform.cs test_ExtensionMethods.cs)
|
||||
|
||||
dotnetlibs/ps_test.dll: $(TEST_SRCS) dotnetlibs/xunit.core.dll dotnetlibs/xunit.assert.dll dotnetlibs/System.Management.Automation.dll dotnetlibs/Microsoft.PowerShell.Commands.Management.dll dotnetlibs/$(ASSEMBLY_LOAD_CONTEXT_TARGET)
|
||||
$(CSC) -out:$@ -noconfig -nostdlib -target:library -r:dotnetlibs/System.Management.Automation.dll -r:dotnetlibs/$(ASSEMBLY_LOAD_CONTEXT_TARGET) -r:dotnetlibs/xunit.core.dll -r:dotnetlibs/xunit.assert.dll ${COREREF} $(TEST_SRCS)
|
||||
|
||||
+1
-1
Submodule src/monad updated: d9e1a2c7b0...f8a9615707
@@ -9,7 +9,11 @@ namespace PSTests
|
||||
// - Remove static keywords
|
||||
static void Main()
|
||||
{
|
||||
PlatformTests.testIsLinux();
|
||||
PlatformTests.TestIsLinux();
|
||||
PlatformTests.TestHasCom();
|
||||
|
||||
PSTypeExtensionsTests.TestIsComObject();
|
||||
|
||||
Console.WriteLine("Finished running tests");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,13 +1,19 @@
|
||||
using Xunit;
|
||||
using System;
|
||||
using System.Management.Automation;
|
||||
|
||||
namespace PSTests
|
||||
{
|
||||
public static class PlatformTests
|
||||
{
|
||||
public static void testIsLinux()
|
||||
public static void TestIsLinux()
|
||||
{
|
||||
Assert.Equal(System.Management.Automation.Platform.IsLinux(), true);
|
||||
Assert.True(Platform.IsLinux());
|
||||
}
|
||||
|
||||
public static void TestHasCom()
|
||||
{
|
||||
Assert.False(Platform.HasCom());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
using Xunit;
|
||||
using System;
|
||||
using System.Management.Automation;
|
||||
|
||||
namespace PSTests
|
||||
{
|
||||
public static class PSTypeExtensionsTests
|
||||
{
|
||||
public static void TestIsComObject()
|
||||
{
|
||||
// It just needs an arbitrary type
|
||||
Assert.False(PSTypeExtensions.IsComObject(42.GetType()));
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user