Skip to content

Commit 8718823

Browse files
committed
Merge pull request #34 from TestStack/auto-ctor2
Version 3.0
2 parents 7ce4bb3 + 8823232 commit 8718823

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+1484
-279
lines changed

BREAKING_CHANGES.md

Lines changed: 36 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,40 @@
11
Breaking Changes
22
================
33

4-
Breaking change from NTestDataBuilder -> TestStack.Dossier 1.0
4+
Version 3.0
5+
-----------
6+
7+
The signature of `IAnonymousValueSupplier` has changed from:
8+
9+
```c#
10+
public interface IAnonymousValueSupplier
11+
{
12+
bool CanSupplyValue(Type type, string propertyName);
13+
TValue GenerateAnonymousValue<TObject, TValue>(AnonymousValueFixture any, string propertyName);
14+
}
15+
```
16+
17+
To:
18+
19+
```c#
20+
public interface IAnonymousValueSupplier
21+
{
22+
bool CanSupplyValue(Type type, string propertyName);
23+
object GenerateAnonymousValue(AnonymousValueFixture any, Type type, string propertyName);
24+
}
25+
```
26+
27+
Note: the `GenerateAnonymousValue` method is no longer generic.
28+
29+
### Reason
30+
31+
In order to implement the `BuildUsing` method that allows you to build an object by convention in one line rather than having to call the constructor yourself we needed to have a non-generic version of the method. This change actually ended up making the anonymous value suppliers slightly easier to implement (no longer any need for type casting).
32+
33+
### Fix
34+
35+
If you have any custom anonymous value suppliers change the signature of your `GenerateAnonymousValue` method so it's no logner generic.
36+
37+
Breaking change from NTestDataBuilder -> TestStack.Dossier 2.0
538
--------------------------------------------------------------
639

740
Namespace has changed from NTestDataBuilder to TestStack.Dossier.
@@ -14,7 +47,7 @@ The project has been renamed.
1447

1548
Do a global find and replace of `using NTestDataBuilder` with `using TestStack.Dossier`.
1649

17-
Breaking change from NTestDataBuilder -> TestStack.Dossier 1.0
50+
Breaking change from NTestDataBuilder -> TestStack.Dossier 2.0
1851
--------------------------------------------------------------
1952

2053
When you don't `Set` a default value for a property that you later `Get` in your builder it will now generate an anonymous value for that property rather than throwing an exception.
@@ -29,7 +62,7 @@ The old behaviour of throwing an exception if a value hasn't been specified is n
2962

3063
If you want to fix a static value for a property then by all means you can still use `Set` calls in your builder constructor. If you aren't happy with the default anonymous value that is generated for a property you can use the `Any` property to generate a value from a different equivalence class in combination with a `Set` call in your builder constructor.
3164

32-
Breaking change from NTestDataBuilder -> TestStack.Dossier 1.0
65+
Breaking change from NTestDataBuilder -> TestStack.Dossier 2.0
3366
--------------------------------------------------------------
3467

3568
The way that lists are generated no longer uses NBuilder - the new syntax is backwards compatible with NBuilder except that the namespace you need to include is different. You can also refactor your list generation to be a lot more terse, but that is optional. Any `BuildList` extension methods you created will now need to be deleted since they are no longer needed. You also need to ensure that all of the methods you call are marked virtual so the list generation can proxy those method calls.

NextVersion.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.1.0
1+
3.0.0

0 commit comments

Comments
 (0)