@@ -94,7 +94,7 @@ public async Task CanDestructureTaskAsync()
94
94
95
95
var properties = propertiesBag . GetResultDictionary ( ) ;
96
96
var destructuredTaskObject = ( IDictionary ? ) properties [ nameof ( TaskCanceledException . Task ) ] ;
97
- var destructuredTaskProperties = Assert . IsAssignableFrom < IDictionary < string , object > > ( destructuredTaskObject ) ;
97
+ var destructuredTaskProperties = Assert . IsType < IDictionary < string , object > > ( destructuredTaskObject , exactMatch : false ) ;
98
98
Assert . Contains ( nameof ( Task . Id ) , destructuredTaskProperties . Keys ) ;
99
99
100
100
Assert . Contains ( nameof ( Task . Status ) , destructuredTaskProperties . Keys ) ;
@@ -118,7 +118,7 @@ public void CanDestructureFaultedTask()
118
118
119
119
var properties = propertiesBag . GetResultDictionary ( ) ;
120
120
var destructuredTaskObject = ( IDictionary ? ) properties [ nameof ( TaskCanceledException . Task ) ] ;
121
- var destructuredTaskProperties = Assert . IsAssignableFrom < IDictionary < string , object > > ( destructuredTaskObject ) ;
121
+ var destructuredTaskProperties = Assert . IsType < IDictionary < string , object > > ( destructuredTaskObject , exactMatch : false ) ;
122
122
Assert . Contains ( nameof ( Task . Id ) , destructuredTaskProperties . Keys ) ;
123
123
124
124
Assert . Contains ( nameof ( Task . Status ) , destructuredTaskProperties . Keys ) ;
@@ -130,17 +130,17 @@ public void CanDestructureFaultedTask()
130
130
Assert . Equal ( nameof ( TaskCreationOptions . None ) , creationOptions ) ;
131
131
132
132
Assert . Contains ( nameof ( Task . Exception ) , destructuredTaskProperties . Keys ) ;
133
- var taskFirstLevelExceptionDictionary = Assert . IsAssignableFrom < IDictionary < string , object > > ( destructuredTaskProperties [ nameof ( Task . Exception ) ] ) ;
133
+ var taskFirstLevelExceptionDictionary = Assert . IsType < IDictionary < string , object > > ( destructuredTaskProperties [ nameof ( Task . Exception ) ] , exactMatch : false ) ;
134
134
Assert . Equal ( nameof ( TaskCreationOptions . None ) , creationOptions ) ;
135
135
136
136
Assert . Contains ( "Message" , taskFirstLevelExceptionDictionary . Keys ) ;
137
137
var message = Assert . IsType < string > ( taskFirstLevelExceptionDictionary [ "Message" ] ) ;
138
138
Assert . Equal ( "One or more errors occurred. (INNER EXCEPTION MESSAGE)" , message ) ;
139
139
140
140
Assert . Contains ( "InnerExceptions" , taskFirstLevelExceptionDictionary . Keys ) ;
141
- var innerExceptions = Assert . IsAssignableFrom < IReadOnlyCollection < object > > ( taskFirstLevelExceptionDictionary [ "InnerExceptions" ] ) ;
141
+ var innerExceptions = Assert . IsType < IReadOnlyCollection < object > > ( taskFirstLevelExceptionDictionary [ "InnerExceptions" ] , exactMatch : false ) ;
142
142
var innerException = Assert . Single ( innerExceptions ) ;
143
- var innerExceptionDictionary = Assert . IsAssignableFrom < IDictionary < string , object > > ( innerException ) ;
143
+ var innerExceptionDictionary = Assert . IsType < IDictionary < string , object > > ( innerException , exactMatch : false ) ;
144
144
Assert . Contains ( "Message" , innerExceptionDictionary . Keys ) ;
145
145
Assert . Equal ( "INNER EXCEPTION MESSAGE" , innerExceptionDictionary [ "Message" ] ) ;
146
146
}
@@ -161,7 +161,7 @@ public void CanDestructureStructDataItem()
161
161
var properties = propertiesBag . GetResultDictionary ( ) ;
162
162
var data = ( IDictionary ? ) properties [ nameof ( Exception . Data ) ] ;
163
163
var testStructDataValue = data ? [ "data" ] ;
164
- Assert . IsAssignableFrom < TestStruct > ( testStructDataValue ) ;
164
+ Assert . IsType < TestStruct > ( testStructDataValue , exactMatch : false ) ;
165
165
}
166
166
167
167
[ Fact ]
@@ -180,7 +180,7 @@ public void CanDestructureClassDataItem()
180
180
var properties = propertiesBag . GetResultDictionary ( ) ;
181
181
var data = ( IDictionary ? ) properties [ nameof ( Exception . Data ) ] ;
182
182
var testStructDataValue = data ? [ "data" ] ;
183
- var destructuredStructDictionary = Assert . IsAssignableFrom < IDictionary < string , object > > ( testStructDataValue ) ;
183
+ var destructuredStructDictionary = Assert . IsType < IDictionary < string , object > > ( testStructDataValue , exactMatch : false ) ;
184
184
Assert . Equal ( 10 , destructuredStructDictionary [ nameof ( TestClass . ValueType ) ] ) ;
185
185
Assert . Equal ( "ABC" , destructuredStructDictionary [ nameof ( TestClass . ReferenceType ) ] ) ;
186
186
}
@@ -319,20 +319,20 @@ public void WhenObjectContainsCyclicReferencesInTask_ThenRecursiveDestructureIsI
319
319
destructurer . Destructure ( exception , result , InnerDestructurer ( destructurer ) ) ;
320
320
321
321
var resultsDictionary = result . GetResultDictionary ( ) ;
322
- var destructuredTask = Assert . IsAssignableFrom < IDictionary < string , object > > ( resultsDictionary [ nameof ( CyclicTaskException . Task ) ] ) ;
322
+ var destructuredTask = Assert . IsType < IDictionary < string , object > > ( resultsDictionary [ nameof ( CyclicTaskException . Task ) ] , exactMatch : false ) ;
323
323
Assert . Contains ( nameof ( Task . Exception ) , destructuredTask . Keys ) ;
324
- var exceptionDictionary = Assert . IsAssignableFrom < IDictionary < string , object > > ( destructuredTask [ nameof ( Task . Exception ) ] ) ;
324
+ var exceptionDictionary = Assert . IsType < IDictionary < string , object > > ( destructuredTask [ nameof ( Task . Exception ) ] , exactMatch : false ) ;
325
325
Assert . Contains ( nameof ( AggregateException . InnerExceptions ) , exceptionDictionary . Keys ) ;
326
- var innerExceptions = Assert . IsAssignableFrom < IReadOnlyCollection < object > > ( exceptionDictionary [ nameof ( AggregateException . InnerExceptions ) ] ) ;
326
+ var innerExceptions = Assert . IsType < IReadOnlyCollection < object > > ( exceptionDictionary [ nameof ( AggregateException . InnerExceptions ) ] , exactMatch : false ) ;
327
327
var innerException = Assert . Single ( innerExceptions ) ;
328
- var destructuredCyclicException = Assert . IsAssignableFrom < IDictionary < string , object > > ( innerException ) ;
328
+ var destructuredCyclicException = Assert . IsType < IDictionary < string , object > > ( innerException , exactMatch : false ) ;
329
329
330
330
Assert . Contains ( nameof ( Exception . Message ) , destructuredCyclicException . Keys ) ;
331
331
var message = Assert . IsType < string > ( destructuredCyclicException [ nameof ( Exception . Message ) ] ) ;
332
332
Assert . Contains ( nameof ( CyclicTaskException ) , message , StringComparison . Ordinal ) ;
333
333
334
334
Assert . Contains ( nameof ( CyclicTaskException . Task ) , destructuredCyclicException . Keys ) ;
335
- var task2 = Assert . IsAssignableFrom < IDictionary < string , object > > ( destructuredCyclicException [ nameof ( CyclicTaskException . Task ) ] ) ;
335
+ var task2 = Assert . IsType < IDictionary < string , object > > ( destructuredCyclicException [ nameof ( CyclicTaskException . Task ) ] , exactMatch : false ) ;
336
336
Assert . Contains ( "$ref" , task2 ) ;
337
337
}
338
338
0 commit comments