Skip to content

Commit 6b04558

Browse files
committed
Merge pull request #48 from dennisroche/add-testbuilder-interface
Added ITestDataBuilder interface
2 parents 57e8088 + db8845e commit 6b04558

File tree

3 files changed

+17
-1
lines changed

3 files changed

+17
-1
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
namespace TestStack.Dossier
2+
{
3+
/// <summary>
4+
/// Base class definining infrastructure for a class that generates objects of type {TObject}.
5+
/// </summary>
6+
/// <typeparam name="TObject">The type of object this class generates</typeparam>
7+
public interface ITestDataBuilder<out TObject> where TObject : class
8+
{
9+
/// <summary>
10+
/// Build the object.
11+
/// </summary>
12+
/// <returns>The built object</returns>
13+
TObject Build();
14+
}
15+
}

TestStack.Dossier/TestDataBuilder.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ namespace TestStack.Dossier
1111
/// </summary>
1212
/// <typeparam name="TObject">The type of object this class generates</typeparam>
1313
/// <typeparam name="TBuilder">The type for this class, yes this is a recursive type definition</typeparam>
14-
public abstract class TestDataBuilder<TObject, TBuilder>
14+
public abstract class TestDataBuilder<TObject, TBuilder> : ITestDataBuilder<TObject>
1515
where TObject : class
1616
where TBuilder : TestDataBuilder<TObject, TBuilder>, new()
1717
{

TestStack.Dossier/TestStack.Dossier.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
<ItemGroup>
5353
<Compile Include="AnonymousValueFixture.cs" />
5454
<Compile Include="Builder.cs" />
55+
<Compile Include="ITestDataBuilder.cs" />
5556
<Compile Include="DataSources\Dictionaries\Cache.cs" />
5657
<Compile Include="DataSources\Dictionaries\IDictionaryRepository.cs" />
5758
<Compile Include="DataSources\Dictionaries\CachedFileDictionaryRepository.cs" />

0 commit comments

Comments
 (0)