File tree 2 files changed +5
-9
lines changed
2 files changed +5
-9
lines changed Original file line number Diff line number Diff line change @@ -75,12 +75,5 @@ public void ContainProperty(string propertyName)
75
75
Execute . Assertion . ForCondition ( _subject . TryGetProperty ( propertyName , out _ ) )
76
76
. FailWith ( $ "Expected JSON element '{ escapedJson } ' to contain a property named '{ propertyName } '.") ;
77
77
}
78
-
79
- public void BeJson ( string expectedDocument )
80
- {
81
- string json = _subject . ToString ( ) ;
82
-
83
- json . Should ( ) . BeJson ( expectedDocument ) ;
84
- }
85
78
}
86
79
}
Original file line number Diff line number Diff line change 1
1
using System . Reflection ;
2
2
using System . Text . Json ;
3
+ using FluentAssertions ;
4
+ using TestBuildingBlocks ;
3
5
using Xunit ;
4
6
5
7
namespace OpenApiTests . LegacyOpenApiIntegration ;
@@ -21,10 +23,11 @@ public async Task Retrieved_document_matches_expected_document()
21
23
string expectedDocument = await LoadEmbeddedResourceAsync ( embeddedResourceName ) ;
22
24
23
25
// Act
24
- JsonElement actualDocument = await LazyDocument . Value ;
26
+ JsonElement jsonElement = await LazyDocument . Value ;
25
27
26
28
// Assert
27
- actualDocument . Should ( ) . BeJson ( expectedDocument ) ;
29
+ string jsonText = jsonElement . ToString ( ) ;
30
+ jsonText . Should ( ) . BeJson ( expectedDocument ) ;
28
31
}
29
32
30
33
private static async Task < string > LoadEmbeddedResourceAsync ( string name )
You can’t perform that action at this time.
0 commit comments