From db8845e4637646a90e706693d383285f726dc2ab Mon Sep 17 00:00:00 2001 From: Dennis Roche Date: Wed, 9 Dec 2015 09:49:45 +0800 Subject: [PATCH] Added ITestDataBuilder interface --- TestStack.Dossier/ITestDataBuilder.cs | 15 +++++++++++++++ TestStack.Dossier/TestDataBuilder.cs | 2 +- TestStack.Dossier/TestStack.Dossier.csproj | 1 + 3 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 TestStack.Dossier/ITestDataBuilder.cs diff --git a/TestStack.Dossier/ITestDataBuilder.cs b/TestStack.Dossier/ITestDataBuilder.cs new file mode 100644 index 0000000..4dd8591 --- /dev/null +++ b/TestStack.Dossier/ITestDataBuilder.cs @@ -0,0 +1,15 @@ +namespace TestStack.Dossier +{ + /// + /// Base class definining infrastructure for a class that generates objects of type {TObject}. + /// + /// The type of object this class generates + public interface ITestDataBuilder where TObject : class + { + /// + /// Build the object. + /// + /// The built object + TObject Build(); + } +} diff --git a/TestStack.Dossier/TestDataBuilder.cs b/TestStack.Dossier/TestDataBuilder.cs index 24edb91..224f300 100644 --- a/TestStack.Dossier/TestDataBuilder.cs +++ b/TestStack.Dossier/TestDataBuilder.cs @@ -11,7 +11,7 @@ namespace TestStack.Dossier /// /// The type of object this class generates /// The type for this class, yes this is a recursive type definition - public abstract class TestDataBuilder + public abstract class TestDataBuilder : ITestDataBuilder where TObject : class where TBuilder : TestDataBuilder, new() { diff --git a/TestStack.Dossier/TestStack.Dossier.csproj b/TestStack.Dossier/TestStack.Dossier.csproj index 18981de..ebc247e 100644 --- a/TestStack.Dossier/TestStack.Dossier.csproj +++ b/TestStack.Dossier/TestStack.Dossier.csproj @@ -52,6 +52,7 @@ +