Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit ecb9e64

Browse files
committed
Fix unit tests for new code merged before Core migration
1 parent 27ad5b1 commit ecb9e64

File tree

4 files changed

+23
-5
lines changed

4 files changed

+23
-5
lines changed

‎src/CommandLine/project.json‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@
4141
"System.Linq": "4.1.0",
4242
"System.Diagnostics.Debug": "4.0.11",
4343
"System.Console": "4.0.0",
44-
"System.Reflection.Extensions": "4.0.1"
44+
"System.Reflection.Extensions": "4.0.1",
45+
"System.Text.RegularExpressions": "4.1.0"
4546
},
4647
"imports": [ "netcore45" ]
4748
},
@@ -55,4 +56,4 @@
5556
"frameworkAssemblies": { }
5657
}
5758
}
58-
}
59+
}

‎tests/CommandLine.Tests/Fakes/Help_Fakes.cs‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
using System.Collections.Generic;
44
using CommandLine.Text;
5-
using Microsoft.FSharp.Collections;
65

76
namespace CommandLine.Tests.Fakes
87
{

‎tests/CommandLine.Tests/Unit/ParserTests.cs‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -539,8 +539,14 @@ public void Properly_formatted_help_screen_is_displayed_when_there_is_a_hidden_v
539539

540540
// Verify outcome
541541
var lines = result.ToNotEmptyLines().TrimStringArray();
542+
#if !PLATFORM_DOTNET
542543
lines[0].Should().StartWithEquivalent("CommandLine");
543544
lines[1].ShouldBeEquivalentTo("Copyright (c) 2005 - 2015 Giacomo Stelluti Scala");
545+
#else
546+
// Takes the name of the xUnit test program
547+
lines[0].Should().StartWithEquivalent("xUnit");
548+
lines[1].Should().StartWithEquivalent("Copyright (C) Outercurve Foundation");
549+
#endif
544550
lines[2].ShouldBeEquivalentTo("ERROR(S):");
545551
lines[3].ShouldBeEquivalentTo("No verb selected.");
546552
lines[4].ShouldBeEquivalentTo("add Add file contents to the index.");
@@ -563,8 +569,14 @@ public void Properly_formatted_help_screen_is_displayed_when_there_is_a_hidden_v
563569

564570
// Verify outcome
565571
var lines = result.ToNotEmptyLines().TrimStringArray();
572+
#if !PLATFORM_DOTNET
566573
lines[0].Should().StartWithEquivalent("CommandLine");
567574
lines[1].ShouldBeEquivalentTo("Copyright (c) 2005 - 2015 Giacomo Stelluti Scala");
575+
#else
576+
// Takes the name of the xUnit test program
577+
lines[0].Should().StartWithEquivalent("xUnit");
578+
lines[1].Should().StartWithEquivalent("Copyright (C) Outercurve Foundation");
579+
#endif
568580
lines[2].ShouldBeEquivalentTo("-f, --force Allow adding otherwise ignored files.");
569581
lines[3].ShouldBeEquivalentTo("--help Display this help screen.");
570582
lines[4].ShouldBeEquivalentTo("--version Display version information.");

‎tests/CommandLine.Tests/Unit/Text/HelpTextTests.cs‎

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -384,8 +384,14 @@ public void Invoke_AutoBuild_for_Verbs_with_specific_verb_returns_appropriate_fo
384384
// Verify outcome
385385
var lines = helpText.ToString().ToNotEmptyLines().TrimStringArray();
386386

387+
#if !PLATFORM_DOTNET
387388
lines[0].Should().StartWithEquivalent("CommandLine");
388-
lines[1].Should().StartWithEquivalent("Copyright (c)");
389+
lines[1].ShouldBeEquivalentTo("Copyright (c) 2005 - 2015 Giacomo Stelluti Scala");
390+
#else
391+
// Takes the name of the xUnit test program
392+
lines[0].Should().StartWithEquivalent("xUnit");
393+
lines[1].Should().StartWithEquivalent("Copyright (C) Outercurve Foundation");
394+
#endif
389395
lines[2].ShouldBeEquivalentTo("-p, --patch Use the interactive patch selection interface to chose which changes to commit.");
390396
lines[3].ShouldBeEquivalentTo("--amend Used to amend the tip of the current branch.");
391397
lines[4].ShouldBeEquivalentTo("-m, --message Use the given message as the commit message.");
@@ -559,4 +565,4 @@ public void Default_set_to_sequence_should_be_properly_printed()
559565
}
560566
#endif
561567
}
562-
}
568+
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /