File tree Expand file tree Collapse file tree 1 file changed +30
-0
lines changed
Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -50,4 +50,34 @@ public void MemberAutoNSubstituteData_Should_Call_For_Each_MemberData_Values(
5050 dependantType . Should ( ) . NotBeNull ( ) ;
5151 dependantType . Dependency . Should ( ) . Be ( interfaceType ) ;
5252 }
53+
54+ [ Theory ]
55+ [ MemberAutoNSubstituteData ( nameof ( DataFrozenProvided ) ) ]
56+ public void MemberData_SuppliesValueForFrozenParameter_ReusedForDependants (
57+ [ Frozen ] ISampleInterface frozen ,
58+ SampleDependantClass dependant )
59+ {
60+ frozen . Should ( ) . NotBeNull ( ) ;
61+ dependant . Should ( ) . NotBeNull ( ) ;
62+ dependant . Dependency . Should ( ) . BeSameAs ( frozen ) ;
63+ }
64+
65+ [ Theory ]
66+ [ MemberAutoNSubstituteData ( nameof ( DataFrozenProvided ) ) ]
67+ public void MemberData_SuppliesValueEarlier_ReusedByLaterFrozenParameter (
68+ ISampleInterface provided ,
69+ [ Frozen ] ISampleInterface frozen ,
70+ SampleDependantClass dependant )
71+ {
72+ provided . Should ( ) . NotBeNull ( ) ;
73+ frozen . Should ( ) . NotBeNull ( ) ;
74+ dependant . Should ( ) . NotBeNull ( ) ;
75+ frozen . Should ( ) . BeSameAs ( provided ) ;
76+ dependant . Dependency . Should ( ) . BeSameAs ( provided ) ;
77+ }
78+
79+ public static IEnumerable < object ? [ ] > DataFrozenProvided ( )
80+ {
81+ yield return [ Substitute . For < ISampleInterface > ( ) ] ;
82+ }
5383}
You can’t perform that action at this time.
0 commit comments