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
38 lines (33 loc) · 1.12 KB
/
CommandLine.cs
File metadata and controls
38 lines (33 loc) · 1.12 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
37
38
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"
.f(() => exception = Record.Exception(() => ScriptCsExe.Run(
new[]
{
"-unknownoption"
},
ScenarioDirectory.Create(scenario))));
"Then scriptcs errors"
.f(() => exception.ShouldBeType<ScriptCsException>());
"And I see an error message regarding the unknown option"
.f(() =>
{
exception.Message.ShouldContain("unknownoption");
});
"And I see scriptcs usage details"
.f(() => exception.Message.ShouldContain("Usage:"));
}
}
}