CanGetProcessThreadForManagedThread() test now only runs on Windows systems; removed unused variable from expression tree cloner; removed unused variable from unit test of weak collection; fixed test issue parsing command lines relying on current platform being windows; removed unused variable from Semaphore class

git-svn-id: file:///srv/devel/repo-conversion/nusu@251 d2e56fa2-650e-0410-a79f-9358c0239efd
This commit is contained in:
Markus Ewald 2012-02-12 13:46:19 +00:00
parent 48e016d956
commit 61c858cb1c
5 changed files with 28 additions and 16 deletions

View file

@ -570,8 +570,21 @@ namespace Nuclex.Support.Parsing {
/// Tests whether the existence of named arguments can be checked
/// </summary>
[Test]
public void TestHasArgument() {
CommandLine test = CommandLine.Parse("/first:x /second:y /second:z third");
public void HasArgumentWorksForWindowsStyleArguments() {
CommandLine test = CommandLine.Parse("/first:x /second:y /second:z third", true);
Assert.IsTrue(test.HasArgument("first"));
Assert.IsTrue(test.HasArgument("second"));
Assert.IsFalse(test.HasArgument("third"));
Assert.IsFalse(test.HasArgument("fourth"));
}
/// <summary>
/// Tests whether the existence of named arguments can be checked
/// </summary>
[Test]
public void HasArgumentWorksForUnixStyleArguments() {
CommandLine test = CommandLine.Parse("--first=x --second=y --second=z third", false);
Assert.IsTrue(test.HasArgument("first"));
Assert.IsTrue(test.HasArgument("second"));