Skip to content

Commit 7da1002

Browse files
committed
correcting type in CreateSut() method. Also added two useful methods for creating mocks/anonymous objects
1 parent 352269b commit 7da1002

File tree

4 files changed

+17
-7
lines changed

4 files changed

+17
-7
lines changed

FluentCommandLineParser.Tests/Internals/CommandLineParserEngineMark2Tests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ namespace Fclp.Tests.Internals
3131
{
3232
abstract class CommandLineParserEngineMark2TestContext : TestContextBase<CommandLineParserEngineMark2>
3333
{
34-
Establish context = () => CreatSut();
34+
Establish context = () => CreateSut();
3535
}
3636

3737
sealed class Parse

FluentCommandLineParser.Tests/Internals/CommandLineParserEngineMark2TestsXUnit.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ public void should_parse_single_options_correctly(
104104
expectedValue = ReplaceWithDoubleQuotes(expectedValue);
105105

106106
InitialiseFixture();
107-
CreatSut();
107+
CreateSut();
108108

109109
var result = sut.Parse(convertedArgs);
110110

@@ -161,7 +161,7 @@ public void should_parse_double_options_correctly(
161161
secondExpectedValue = ReplaceWithDoubleQuotes(secondExpectedValue);
162162

163163
InitialiseFixture();
164-
CreatSut();
164+
CreateSut();
165165

166166
var result = sut.Parse(convertedArgs);
167167

@@ -201,7 +201,7 @@ public void should_parse_boolean_values_correctly(
201201
var convertedArgs = ParseArguments(arguments);
202202

203203
InitialiseFixture();
204-
CreatSut();
204+
CreateSut();
205205

206206
var result = sut.Parse(convertedArgs);
207207

@@ -234,7 +234,7 @@ public void should_parse_combined_boolean_values_correctly(
234234
expectedValue = ReplaceWithDoubleQuotes(expectedValue);
235235

236236
InitialiseFixture();
237-
CreatSut();
237+
CreateSut();
238238

239239
var result = sut.Parse(convertedArgs);
240240

FluentCommandLineParser.Tests/Internals/HelpCommandLineOptionTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ sealed class HelpCommandLineOptionTests
3232
{
3333
abstract class HelpCommandLineOptionTestContext : TestContextBase<HelpCommandLineOption>
3434
{
35-
Establish context = () => CreatSut();
35+
Establish context = () => CreateSut();
3636
}
3737

3838

FluentCommandLineParser.Tests/Internals/TestContextBase.cs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ protected static IFixture InitialiseFixture()
4949
return fixture;
5050
}
5151

52-
protected static TSut CreatSut()
52+
protected static TSut CreateSut()
5353
{
5454
sut = fixture.Create<TSut>();
5555
return sut;
@@ -72,5 +72,15 @@ protected static string ReplaceWithDoubleQuotes(string args)
7272
if (args == null) return null;
7373
return args.Replace('\'', '"');
7474
}
75+
76+
protected static void FreezeMock<TType>(out Mock<TType> obj) where TType : class
77+
{
78+
obj = fixture.Freeze<Mock<TType>>();
79+
}
80+
81+
protected static void Create<TType>(out TType obj)
82+
{
83+
obj = fixture.Create<TType>();
84+
}
7585
}
7686
}

0 commit comments

Comments
 (0)