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:
Andrew Schwartzmeyer
2015-06-11 15:27:36 -07:00
parent 99804642fc
commit 13cccf51cc
5 changed files with 30 additions and 5 deletions
+1 -1
View File
@@ -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)
+5 -1
View File
@@ -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");
}
}
+8 -2
View File
@@ -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());
}
}
}
+15
View File
@@ -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()));
}
}
}