Skip to content

Commit 23d88ef

Browse files
committed
extend the tests around the builder
1 parent e746cc9 commit 23d88ef

File tree

2 files changed

+44
-2
lines changed

2 files changed

+44
-2
lines changed

FluentCommandLineParser.Tests/FluentCommandLineParserBuilderTests.cs

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,48 @@ abstract class FluentCommandLineParserBuilderTestContext : TestContextBase<Fluen
3535
Establish context = () => CreateSut();
3636
}
3737

38+
sealed class Constructor
39+
{
40+
class when_initialised : FluentCommandLineParserBuilderTestContext
41+
{
42+
It should_enable_case_sensitive = () =>
43+
sut.IsCaseSensitive.ShouldBeTrue();
44+
45+
It should_have_the_fluent_parser_by_default = () =>
46+
sut.Parser.ShouldBeOfType<IFluentCommandLineParser>();
47+
48+
It should_have_initialised_the_object = () =>
49+
sut.Object.ShouldNotBeNull();
50+
}
51+
}
52+
53+
sealed class IsCaseSensitive
54+
{
55+
abstract class IsCaseSensitiveTestContext : FluentCommandLineParserBuilderTestContext { }
56+
57+
class when_enabled : IsCaseSensitiveTestContext
58+
{
59+
Because of = () => sut.IsCaseSensitive = true;
60+
61+
It should_return_enabled = () =>
62+
sut.IsCaseSensitive.ShouldBeTrue();
63+
64+
It should_enable_case_sensitivity_on_the_parser = () =>
65+
sut.Parser.IsCaseSensitive.ShouldBeTrue();
66+
}
67+
68+
class when_disabled : IsCaseSensitiveTestContext
69+
{
70+
Because of = () => sut.IsCaseSensitive = false;
71+
72+
It should_return_disabled = () =>
73+
sut.IsCaseSensitive.ShouldBeFalse();
74+
75+
It should_disable_case_sensitivity_on_the_parser = () =>
76+
sut.Parser.IsCaseSensitive.ShouldBeFalse();
77+
}
78+
}
79+
3880
sealed class Parse
3981
{
4082
abstract class ParseTestContext : FluentCommandLineParserBuilderTestContext
@@ -89,7 +131,7 @@ class when_required_option_is_not_provided : ParseTestContext
89131

90132
class when_default_is_specified_on_an_option_that_is_not_specified : ParseTestContext
91133
{
92-
protected static string expectedDefaultValue;
134+
static string expectedDefaultValue;
93135

94136
Establish context = () =>
95137
{

FluentCommandLineParser.Tests/FluentCommandLineParserMSpecTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ class when_disabled : IsCaseSensitiveTestContext
8484
{
8585
Because of = () => sut.IsCaseSensitive = false;
8686

87-
It should_return_enabled = () =>
87+
It should_return_disabled = () =>
8888
sut.IsCaseSensitive.ShouldBeFalse();
8989

9090
It should_set_the_comparison_type_to_ignore_case = () =>

0 commit comments

Comments
 (0)