Skip to content

Version 3.0 #34

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 28 commits into from
May 15, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
205c61e
Added a static Builder<T> class to emulate NBuilder behaviour
mwhelan Apr 26, 2015
c57abec
renamed PropertyNameGetter to Reflector to show additional behaviour
mwhelan Apr 26, 2015
48efca4
removed generic CanSupply from IAnonymousValueSupplier
mwhelan Apr 26, 2015
7632277
Updated PR to apply Rob's suggestions.
mwhelan Apr 28, 2015
4607939
Added a protected method called BuildByConstructor that allows a Buil…
Bringer128 May 1, 2015
6551bff
Fixed merge conflicts from PR#32
mwhelan May 1, 2015
4f95399
Introduced Object Builders
mwhelan May 1, 2015
c0c8dbe
Renamed FactoryRegistry to ObjectBuilderRegistry
mwhelan May 1, 2015
a2602a6
Renamed object builders to strategies
mwhelan May 1, 2015
8f0dc5f
Settled on object builder design
mwhelan May 3, 2015
37a290d
Updated Builder to allow customisation of factory
mwhelan May 3, 2015
72280f3
Added tests for various Factories
mwhelan May 3, 2015
89164f0
Added alternative idea for the constructor factories so that the use …
robdmoore May 12, 2015
76264c4
Cleaned up Builder<T> tests
robdmoore May 14, 2015
d95116c
Ensuring factory overrides for Builder<T> work
robdmoore May 14, 2015
c788cb3
Making it explicit that the AutoFixtureFactory does not use values fr…
robdmoore May 14, 2015
f26d418
Moved example builders and objects to TestHelpers so the root namespa…
robdmoore May 14, 2015
68810c9
Adding a ctor-set readonly property to the MixedAccessibilityDto
robdmoore May 14, 2015
9266739
Added tests to ensure the correct behaviour for the factories with re…
robdmoore May 14, 2015
a28a6be
Removing redundant method
robdmoore May 14, 2015
e0d928f
Removed the redundant method in AnonymousValueFixture and bumped to v…
robdmoore May 14, 2015
6f3053f
Documentation update
robdmoore May 14, 2015
559a968
Made BuildObject virtual rather than abstract
mwhelan May 14, 2015
775f87b
Added ability to set child builders when using Builder<T>
robdmoore May 14, 2015
48acf15
Added documentation for sharing anonymous value fixtures across builders
robdmoore May 14, 2015
cd36b74
Merge remote-tracking branch 'TestStack/auto-ctor2'
mwhelan May 15, 2015
3d924d2
Set default Factory to PublicPropertySettersFactory
mwhelan May 15, 2015
8823232
Updated the readme
mwhelan May 15, 2015
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 36 additions & 3 deletions BREAKING_CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,40 @@
Breaking Changes
================

Breaking change from NTestDataBuilder -> TestStack.Dossier 1.0
Version 3.0
-----------

The signature of `IAnonymousValueSupplier` has changed from:

```c#
public interface IAnonymousValueSupplier
{
bool CanSupplyValue(Type type, string propertyName);
TValue GenerateAnonymousValue<TObject, TValue>(AnonymousValueFixture any, string propertyName);
}
```

To:

```c#
public interface IAnonymousValueSupplier
{
bool CanSupplyValue(Type type, string propertyName);
object GenerateAnonymousValue(AnonymousValueFixture any, Type type, string propertyName);
}
```

Note: the `GenerateAnonymousValue` method is no longer generic.

### Reason

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).

### Fix

If you have any custom anonymous value suppliers change the signature of your `GenerateAnonymousValue` method so it's no logner generic.

Breaking change from NTestDataBuilder -> TestStack.Dossier 2.0
--------------------------------------------------------------

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

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

Breaking change from NTestDataBuilder -> TestStack.Dossier 1.0
Breaking change from NTestDataBuilder -> TestStack.Dossier 2.0
--------------------------------------------------------------

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.
Expand All @@ -29,7 +62,7 @@ The old behaviour of throwing an exception if a value hasn't been specified is n

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.

Breaking change from NTestDataBuilder -> TestStack.Dossier 1.0
Breaking change from NTestDataBuilder -> TestStack.Dossier 2.0
--------------------------------------------------------------

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.
Expand Down
2 changes: 1 addition & 1 deletion NextVersion.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.1.0
3.0.0
Loading