File tree Expand file tree Collapse file tree 2 files changed +17
-6
lines changed
TestStack.Dossier.Tests/Factories
TestStack.Dossier/Factories Expand file tree Collapse file tree 2 files changed +17
-6
lines changed Original file line number Diff line number Diff line change @@ -13,15 +13,26 @@ public void GivenAutoFixtureFactory_WhenBuilding_ThenOnlyConstructorAndPublicPro
1313 {
1414 MixedAccessibilityDto dto = Builder < MixedAccessibilityDto > . CreateNew ( new AutoFixtureFactory ( ) ) ;
1515
16- // ctor properties
1716 dto . SetByCtorWithPrivateSetter . ShouldNotBe ( null ) ;
1817 dto . SetByCtorWithPublicSetter . ShouldNotBe ( null ) ;
19-
20- // public properties
18+ dto . NotSetByCtorWithPrivateSetter . ShouldBe ( null ) ;
2119 dto . NotSetByCtorWithPublicSetter . ShouldNotBe ( null ) ;
20+ }
2221
23- // private properties
24- dto . NotSetByCtorWithPrivateSetter . ShouldBe ( null ) ;
22+ [ Fact ]
23+ public void GivenAutoFixtureFactoryAgainstBuilderWithModifications_WhenBuilding_ThenNoCustomisationsAreUsed ( )
24+ {
25+ MixedAccessibilityDto dto = Builder < MixedAccessibilityDto >
26+ . CreateNew ( new AutoFixtureFactory ( ) )
27+ . Set ( x => x . SetByCtorWithPrivateSetter , "1" )
28+ . Set ( x => x . SetByCtorWithPublicSetter , "2" )
29+ . Set ( x => x . NotSetByCtorWithPrivateSetter , "3" )
30+ . Set ( x => x . NotSetByCtorWithPublicSetter , "4" ) ;
31+
32+ dto . SetByCtorWithPrivateSetter . ShouldNotBe ( "1" ) ;
33+ dto . SetByCtorWithPublicSetter . ShouldNotBe ( "2" ) ;
34+ dto . NotSetByCtorWithPrivateSetter . ShouldNotBe ( "3" ) ;
35+ dto . NotSetByCtorWithPublicSetter . ShouldNotBe ( "4" ) ;
2536 }
2637 }
2738}
Original file line number Diff line number Diff line change 33namespace TestStack . Dossier . Factories
44{
55 /// <summary>
6- /// Creates an instance of an object with AutoFixture.
6+ /// Creates an instance of an object with AutoFixture - any values set in your builder will NOT be used to construct the object .
77 /// </summary>
88 public class AutoFixtureFactory : IFactory
99 {
You can’t perform that action at this time.
0 commit comments