@@ -18,8 +18,8 @@ namespace FluentAssertions.DataSets;
1818public class DataRowAssertions < TDataRow > : ReferenceTypeAssertions < TDataRow , DataRowAssertions < TDataRow > >
1919 where TDataRow : DataRow
2020{
21- public DataRowAssertions ( TDataRow dataRow )
22- : base ( dataRow )
21+ public DataRowAssertions ( TDataRow dataRow , AssertionChain assertionChain )
22+ : base ( dataRow , assertionChain )
2323 {
2424 }
2525
@@ -41,14 +41,14 @@ public AndWhichConstraint<DataRowAssertions<TDataRow>, DataColumn> HaveColumn(st
4141
4242 if ( Subject is null )
4343 {
44- Execute . Assertion
44+ CurrentAssertionChain
4545 . BecauseOf ( because , becauseArgs )
4646 . FailWith ( "Expected {context:DataRow} to contain a column named {0}{reason}, but found <null>." ,
4747 expectedColumnName ) ;
4848 }
4949 else if ( ! Subject . Table . Columns . Contains ( expectedColumnName ) )
5050 {
51- Execute . Assertion
51+ CurrentAssertionChain
5252 . BecauseOf ( because , becauseArgs )
5353 . FailWith ( "Expected {context:DataRow} to contain a column named {0}{reason}, but it does not." ,
5454 expectedColumnName ) ;
@@ -84,18 +84,18 @@ public AndConstraint<DataRowAssertions<TDataRow>> HaveColumns(params string[] ex
8484 public AndConstraint < DataRowAssertions < TDataRow > > HaveColumns ( IEnumerable < string > expectedColumnNames , string because = "" ,
8585 params object [ ] becauseArgs )
8686 {
87- bool success = Execute . Assertion
87+ CurrentAssertionChain
8888 . ForCondition ( Subject is not null )
8989 . BecauseOf ( because , becauseArgs )
9090 . FailWith (
9191 "Expected {context:DataRow} to be in a table containing {0} column(s) with specific names{reason}, but found <null>." ,
9292 ( ) => expectedColumnNames . Count ( ) ) ;
9393
94- if ( success )
94+ if ( CurrentAssertionChain . Succeeded )
9595 {
9696 foreach ( var expectedColumnName in expectedColumnNames )
9797 {
98- Execute . Assertion
98+ CurrentAssertionChain
9999 . ForCondition ( Subject . Table . Columns . Contains ( expectedColumnName ) )
100100 . BecauseOf ( because , becauseArgs )
101101 . 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
194194 var defaults = new DataEquivalencyAssertionOptions < DataRow > ( AssertionOptions . CloneDefaults < DataRow > ( ) ) ;
195195 IDataEquivalencyAssertionOptions < DataRow > options = config ( defaults ) ;
196196
197- var context = new EquivalencyValidationContext ( Node . From < DataRow > ( ( ) => AssertionScope . Current . CallerIdentity ) , options )
197+ var context = new EquivalencyValidationContext ( Node . From < DataRow > ( ( ) => CallerIdentifier . DetermineCallerIdentity ( ) ) , options )
198198 {
199199 Reason = new Reason ( because , becauseArgs ) ,
200200 TraceWriter = options . TraceWriter
0 commit comments