Skip to content

Commit 0c4b112

Browse files
committed
Renamed DataBuilder class to TestDataBuilder
1 parent ef31b2f commit 0c4b112

File tree

6 files changed

+13
-13
lines changed

6 files changed

+13
-13
lines changed

NTestDataBuilder.Tests/Builders/BasicCustomerBuilder.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
namespace NTestDataBuilder.Tests.Builders
44
{
5-
class BasicCustomerBuilder : DataBuilder<Customer, BasicCustomerBuilder>
5+
class BasicCustomerBuilder : TestDataBuilder<Customer, BasicCustomerBuilder>
66
{
77
protected override Customer BuildObject()
88
{

NTestDataBuilder.Tests/Builders/CustomerBuilder.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public static IList<Customer> BuildList(this IListBuilder<CustomerBuilder> list)
1717
}
1818
}
1919

20-
class CustomerBuilder : DataBuilder<Customer, CustomerBuilder>
20+
class CustomerBuilder : TestDataBuilder<Customer, CustomerBuilder>
2121
{
2222
public CustomerBuilder()
2323
{

NTestDataBuilder.Tests/Builders/ProxyAlteringCustomerBuilder.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
namespace NTestDataBuilder.Tests.Builders
66
{
7-
class ProxyAlteringCustomerBuilder : DataBuilder<Customer, ProxyAlteringCustomerBuilder>
7+
class ProxyAlteringCustomerBuilder : TestDataBuilder<Customer, ProxyAlteringCustomerBuilder>
88
{
99
private int _years;
1010

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ namespace NTestDataBuilder
99
/// Generates objects of type <see cref="T"/>.
1010
/// </summary>
1111
/// <typeparam name="T">The type of object this class generates</typeparam>
12-
public interface IDataBuilder<out T> where T : class
12+
public interface ITestDataBuilder<out T> where T : class
1313
{
1414
/// <summary>
1515
/// Build the object.
@@ -23,9 +23,9 @@ public interface IDataBuilder<out T> where T : class
2323
/// </summary>
2424
/// <typeparam name="TObject">The type of object this class generates</typeparam>
2525
/// <typeparam name="TBuilder">The type for this class, yes this is a recursive type definition</typeparam>
26-
public abstract class DataBuilder<TObject, TBuilder> : IDataBuilder<TObject>
26+
public abstract class TestDataBuilder<TObject, TBuilder> : ITestDataBuilder<TObject>
2727
where TObject : class
28-
where TBuilder : class, IDataBuilder<TObject>
28+
where TBuilder : class, ITestDataBuilder<TObject>
2929
{
3030
private readonly Dictionary<string, object> _properties = new Dictionary<string, object>();
3131
private ProxyBuilder<TObject> _proxyBuilder;

NTestDataBuilder/DataBuilderExtensions.cs renamed to NTestDataBuilder/TestDataBuilderExtensions.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
namespace NTestDataBuilder
66
{
77
/// <summary>
8-
/// Extension methods against the <see cref="DataBuilder{TObject,TBuilder}"/> class.
8+
/// Extension methods against the <see cref="TestDataBuilder{TObject,TBuilder}"/> class.
99
/// </summary>
10-
public static class DataBuilderExtensions
10+
public static class TestDataBuilderExtensions
1111
{
1212
/// <summary>
1313
/// Builds a list of entities given an NBuilder list expression of data builders.
@@ -17,7 +17,7 @@ public static class DataBuilderExtensions
1717
/// <param name="builderList">The NBuilder list of builders</param>
1818
/// <returns>The built list of objects</returns>
1919
public static IList<TObject> BuildList<TObject, TBuilder>(this IOperable<TBuilder> builderList)
20-
where TBuilder : IDataBuilder<TObject>
20+
where TBuilder : ITestDataBuilder<TObject>
2121
where TObject : class
2222
{
2323
return builderList.Build().Select(b => b.Build()).ToList();
@@ -31,7 +31,7 @@ public static IList<TObject> BuildList<TObject, TBuilder>(this IOperable<TBuilde
3131
/// <param name="builderList">The NBuilder list of builders</param>
3232
/// <returns>The built list of objects</returns>
3333
public static IList<TObject> BuildList<TObject, TBuilder>(this IListBuilder<TBuilder> builderList)
34-
where TBuilder : IDataBuilder<TObject>
34+
where TBuilder : ITestDataBuilder<TObject>
3535
where TObject : class
3636
{
3737
return builderList.All().BuildList<TObject, TBuilder>();

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ How do I get started?
4545

4646
// CustomerBuilder.cs
4747
48-
class CustomerBuilder : DataBuilder<Customer, CustomerBuilder>
48+
class CustomerBuilder : TestDataBuilder<Customer, CustomerBuilder>
4949
{
5050
public CustomerBuilder()
5151
{
@@ -137,7 +137,7 @@ This library integrates with [NSubstitute](http://nsubstitute.github.io/) for ge
137137
If you need to alter the proxy before calling `Build` to add complex behaviours that can't be expressed by the default public properties returns values then you can override the `AlterProxy` method in your builder, e.g.
138138

139139
```c#
140-
class CustomerBuilder : DataBuilder<Customer, CustomerBuilder>
140+
class CustomerBuilder : TestDataBuilder<Customer, CustomerBuilder>
141141
{
142142
// ...
143143
@@ -170,7 +170,7 @@ Why does NTestDataBuilder have NSubstitute and NBuilder as dependencies?
170170

171171
NTestDataBuilder is an opinionated framework and as such prescribes how to build your fixture data, including how to build lists and how to build mock objects. Because of this we have decided to bundle it with the two best of breed libraries for this purpose: NBuilder and NSubstitute.
172172

173-
This allows for this library to provide a rich value-add on top of the basics of tracking properties in a dictionary in the `DataBuilder` base class. If you want to use different libraries or want a cut down version that doesn't come with NSubstitute or NBuilder and the extra functionality they bring then take the `DataBuilder.cs` file and cut out the bits you don't want - open source ftw :).
173+
This allows for this library to provide a rich value-add on top of the basics of tracking properties in a dictionary in the `TestDataBuilder` base class. If you want to use different libraries or want a cut down version that doesn't come with NSubstitute or NBuilder and the extra functionality they bring then take the `TestDataBuilder.cs` file and cut out the bits you don't want - open source ftw :).
174174

175175
If you have a suggestion for the library that can incorporate this value-add without bundling these libraries feel free to submit a pull request.
176176

0 commit comments

Comments
 (0)