Skip to content

Commit bc1c22b

Browse files
committed
Merge pull request #22 from robdmoore/teststack.dossier
Teststack.Dossier
2 parents dbbeb4e + 2ff3790 commit bc1c22b

File tree

161 files changed

+34166
-705
lines changed

Some content is hidden

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

161 files changed

+34166
-705
lines changed

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,6 @@ _ReSharper.*
99
*~
1010
*.log
1111
packages
12-
*.DotSettings
12+
*.DotSettings
13+
*.ncrunchproject
14+
*.ncrunchsolution

BREAKING_CHANGES.md

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
Breaking Changes
2+
================
3+
4+
Breaking change from NTestDataBuilder -> TestStack.Dossier 1.0
5+
--------------------------------------------------------------
6+
7+
Namespace has changed from NTestDataBuilder to TestStack.Dossier.
8+
9+
### Reason
10+
11+
The project has been renamed.
12+
13+
### Fix
14+
15+
Do a global find and replace of `using NTestDataBuilder` with `using TestStack.Dossier`.
16+
17+
Breaking change from NTestDataBuilder -> TestStack.Dossier 1.0
18+
--------------------------------------------------------------
19+
20+
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.
21+
22+
### Reason
23+
24+
This is part of the work to make anonymous values a first class citizen of the library and to make it easier and quicker to tersely set up builders. This avoids the need to have boilerplate `Set` calls in your builder constructor and also means that when you generate a list of objects each object will have a different value (by default).
25+
26+
### Fix
27+
28+
The old behaviour of throwing an exception if a value hasn't been specified is no longer supported - use NTestDataBuilder version 1 if you want that or raise an issue on GitHub to explain your use case.
29+
30+
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.
31+
32+
Breaking change from NTestDataBuilder -> TestStack.Dossier 1.0
33+
--------------------------------------------------------------
34+
35+
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.
36+
37+
### Reason
38+
In order to support a new, much terser syntax for generating lists we rewrote the list generation code ourselves. You can now do this:
39+
40+
```c#
41+
var customers = CustomerBuilder.CreateListOfSize(3)
42+
.TheFirst(1).WithFirstName("Robert")
43+
.TheLast(1).WithEmail("[email protected]")
44+
.BuildList();
45+
```
46+
47+
That's instead of this syntax (which still works as well):
48+
49+
```c#
50+
var customers = CustomerBuilder.CreateListOfSize(3)
51+
.TheFirst(1).With(b => b.WithFirstName("Robert"))
52+
.TheLast(1).With(b => b.WithEmail("[email protected]"))
53+
.BuildList();
54+
```
55+
56+
You also no longer need a custom extension method for the `BuildList` method so you will need to delete any of these that you have created. If you don't use NBuilder's features outside of the list generation you may uninstall the NBuilder package.
57+
58+
### Fix
59+
60+
Simply add the following to the files that generate lists of builders and change your builder modification methods to be virtual and the existing syntax should work:
61+
62+
```
63+
using TestStack.Dossier.Lists;
64+
```
65+
66+
Assuming you aren't using NBuilder for anything other than generating lists of entities with NTestDataBuilder 1.0 you should be able to do a global find and replace against `using FizzWare.NBuilder;`.
67+
68+
If you uninstall the NBuilder package then you will need to remove the using statements for that library too.
69+
70+
Also, remove any `BuildList` extension methods you created.

NTestDataBuilder.Tests/BuildListTests.cs

Lines changed: 0 additions & 83 deletions
This file was deleted.

NTestDataBuilder.Tests/Builders/BasicCustomerBuilder.cs

Lines changed: 0 additions & 12 deletions
This file was deleted.

NTestDataBuilder.Tests/Builders/CustomerBuilder.cs

Lines changed: 0 additions & 56 deletions
This file was deleted.

NTestDataBuilder.Tests/CreateListTests.cs

Lines changed: 0 additions & 52 deletions
This file was deleted.

NTestDataBuilder.Tests/NTestDataBuilder.Tests.csproj

Lines changed: 0 additions & 80 deletions
This file was deleted.

NTestDataBuilder.Tests/packages.config

Lines changed: 0 additions & 6 deletions
This file was deleted.

0 commit comments

Comments
 (0)