Add passing GetUserName unit test

Updates monad-native submodule to include GetUserName P/Invoke, and
updates monad submodule to use said P/Invoke.

Matches the username against ^[a-z][a-z0-9\-]*$
This commit is contained in:
Andrew Schwartzmeyer
2015-08-04 14:48:12 -07:00
parent f86f856ba6
commit 2a6305ca11
3 changed files with 10 additions and 2 deletions
+8
View File
@@ -41,5 +41,13 @@ namespace PSTests
{
Assert.False(Platform.HasRegistrySupport());
}
[Fact]
public static void TestGetUserName()
{
// Use Assert.Equal("yourusername",
// Platform.NonWindowsGetUserName()) to test without regex
Assert.Matches("^[a-z][a-z0-9\\-]*$", Platform.NonWindowsGetUserName());
}
}
}