forked from scriptcs/scriptcs
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCommandLine.cs
More file actions
36 lines (32 loc) · 1.06 KB
/
CommandLine.cs
File metadata and controls
36 lines (32 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
namespace ScriptCs.Tests.Acceptance
{
using System;
using System.Reflection;
using ScriptCs.Tests.Acceptance.Support;
using Should;
using Xbehave;
using Xunit;
public class CommandLine
{
[Scenario]
public static void UnexpectedOption(Exception exception)
{
var scenario = MethodBase.GetCurrentMethod().GetFullName();
"When I execute scriptcs with an unknown option"
.x(() => exception = Record.Exception(() => ScriptCsExe.Run(
new[]
{
"-unknownoption"
},
ScenarioDirectory.Create(scenario))));
"Then scriptcs errors"
.x(() => exception.ShouldBeType<ScriptCsException>());
"And I see an error message regarding the unknown option"
.x(() =>
{
Console.WriteLine(exception);
exception.Message.ShouldContain("Usage: scriptcs options");
});
}
}
}