@@ -18,8 +18,8 @@ namespace FluentAssertions.DataSets;
18
18
public class DataRowAssertions < TDataRow > : ReferenceTypeAssertions < TDataRow , DataRowAssertions < TDataRow > >
19
19
where TDataRow : DataRow
20
20
{
21
- public DataRowAssertions ( TDataRow dataRow )
22
- : base ( dataRow )
21
+ public DataRowAssertions ( TDataRow dataRow , AssertionChain assertionChain )
22
+ : base ( dataRow , assertionChain )
23
23
{
24
24
}
25
25
@@ -41,14 +41,14 @@ public AndWhichConstraint<DataRowAssertions<TDataRow>, DataColumn> HaveColumn(st
41
41
42
42
if ( Subject is null )
43
43
{
44
- Execute . Assertion
44
+ CurrentAssertionChain
45
45
. BecauseOf ( because , becauseArgs )
46
46
. FailWith ( "Expected {context:DataRow} to contain a column named {0}{reason}, but found <null>." ,
47
47
expectedColumnName ) ;
48
48
}
49
49
else if ( ! Subject . Table . Columns . Contains ( expectedColumnName ) )
50
50
{
51
- Execute . Assertion
51
+ CurrentAssertionChain
52
52
. BecauseOf ( because , becauseArgs )
53
53
. FailWith ( "Expected {context:DataRow} to contain a column named {0}{reason}, but it does not." ,
54
54
expectedColumnName ) ;
@@ -84,18 +84,18 @@ public AndConstraint<DataRowAssertions<TDataRow>> HaveColumns(params string[] ex
84
84
public AndConstraint < DataRowAssertions < TDataRow > > HaveColumns ( IEnumerable < string > expectedColumnNames , string because = "" ,
85
85
params object [ ] becauseArgs )
86
86
{
87
- bool success = Execute . Assertion
87
+ CurrentAssertionChain
88
88
. ForCondition ( Subject is not null )
89
89
. BecauseOf ( because , becauseArgs )
90
90
. FailWith (
91
91
"Expected {context:DataRow} to be in a table containing {0} column(s) with specific names{reason}, but found <null>." ,
92
92
( ) => expectedColumnNames . Count ( ) ) ;
93
93
94
- if ( success )
94
+ if ( CurrentAssertionChain . Succeeded )
95
95
{
96
96
foreach ( var expectedColumnName in expectedColumnNames )
97
97
{
98
- Execute . Assertion
98
+ CurrentAssertionChain
99
99
. ForCondition ( Subject . Table . Columns . Contains ( expectedColumnName ) )
100
100
. BecauseOf ( because , becauseArgs )
101
101
. FailWith ( "Expected table containing {context:DataRow} to contain a column named {0}{reason}, but it does not." ,
@@ -194,7 +194,7 @@ public AndConstraint<DataRowAssertions<TDataRow>> BeEquivalentTo(DataRow expecta
194
194
var defaults = new DataEquivalencyAssertionOptions < DataRow > ( AssertionOptions . CloneDefaults < DataRow > ( ) ) ;
195
195
IDataEquivalencyAssertionOptions < DataRow > options = config ( defaults ) ;
196
196
197
- var context = new EquivalencyValidationContext ( Node . From < DataRow > ( ( ) => AssertionScope . Current . CallerIdentity ) , options )
197
+ var context = new EquivalencyValidationContext ( Node . From < DataRow > ( ( ) => CallerIdentifier . DetermineCallerIdentity ( ) ) , options )
198
198
{
199
199
Reason = new Reason ( because , becauseArgs ) ,
200
200
TraceWriter = options . TraceWriter
0 commit comments