@@ -491,7 +491,7 @@ public async Task IWireMockAdminApi_GetMappingAsync_WithProxy_And_ProxyUrlReplac
491
491
492
492
server . Stop ( ) ;
493
493
}
494
-
494
+
495
495
[ Fact ]
496
496
public async Task IWireMockAdminApi_GetRequestsAsync_Json ( )
497
497
{
@@ -854,28 +854,53 @@ public async Task IWireMockAdminApi_GetMappingCodeByGuidAsync()
854
854
server . Stop ( ) ;
855
855
}
856
856
857
- [ Theory ]
858
- [ InlineData ( MappingConverterType . Server ) ]
859
- [ InlineData ( MappingConverterType . Builder ) ]
860
- public async Task IWireMockAdminApi_GetMappingsCode ( MappingConverterType mappingConverterType )
857
+ [ Fact ]
858
+ public async Task IWireMockAdminApi_GetMappingsCode ( )
861
859
{
862
860
// Arrange
863
861
var guid1 = Guid . Parse ( "90356dba-b36c-469a-a17e-669cd84f1f05" ) ;
864
862
var guid2 = Guid . Parse ( "1b731398-4a5b-457f-a6e3-d65e541c428f" ) ;
865
863
var guid3 = Guid . Parse ( "f74fd144-df53-404f-8e35-da22a640bd5f" ) ;
866
864
var guid4 = Guid . Parse ( "4126DEC8-470B-4EFF-93BB-C24F83B8B1FD" ) ;
867
865
var guid5 = Guid . Parse ( "c9929240-7ae8-4a5d-8ed8-0913479f6eeb" ) ;
868
- var guid6 = Guid . Parse ( "397f64ea-b36c-496a-9a32-b96988194724" ) ;
869
866
var server = WireMockServer . StartWithAdminInterface ( ) ;
870
867
868
+ server
869
+ . Given (
870
+ Request . Create ( )
871
+ . WithPath ( "/users/post1" )
872
+ . UsingPost ( )
873
+ . WithBody ( new JsonMatcher ( new
874
+ {
875
+ city = "Amsterdam" ,
876
+ country = "The Netherlands"
877
+ } ) )
878
+ )
879
+ . WithGuid ( guid1 )
880
+ . RespondWith ( Response . Create ( ) ) ;
881
+
882
+ server
883
+ . Given (
884
+ Request . Create ( )
885
+ . WithPath ( "/users/post2" )
886
+ . UsingPost ( )
887
+ . WithBody ( new JsonPartialMatcher ( new
888
+ {
889
+ city = "City" ,
890
+ country = "Country"
891
+ } ) )
892
+ )
893
+ . WithGuid ( guid2 )
894
+ . RespondWith ( Response . Create ( ) . WithBody ( "Line1\r \n Some \" value\" in Line2" ) ) ;
895
+
871
896
server
872
897
. Given (
873
898
Request . Create ( )
874
899
. WithPath ( "/foo1" )
875
900
. WithParam ( "p1" , "xyz" )
876
901
. UsingGet ( )
877
902
)
878
- . WithGuid ( guid1 )
903
+ . WithGuid ( guid3 )
879
904
. RespondWith (
880
905
Response . Create ( )
881
906
. WithStatusCode ( 200 )
@@ -890,7 +915,7 @@ public async Task IWireMockAdminApi_GetMappingsCode(MappingConverterType mapping
890
915
. WithHeader ( "h1" , "W/\" 234f2q3r\" " )
891
916
. UsingPost ( )
892
917
)
893
- . WithGuid ( guid2 )
918
+ . WithGuid ( guid4 )
894
919
. RespondWith (
895
920
Response . Create ( )
896
921
. WithStatusCode ( "201" )
@@ -899,33 +924,6 @@ public async Task IWireMockAdminApi_GetMappingsCode(MappingConverterType mapping
899
924
. WithBody ( "2" )
900
925
) ;
901
926
902
- server
903
- . Given (
904
- Request . Create ( )
905
- . WithPath ( "/users/post1" )
906
- . UsingPost ( )
907
- . WithBodyAsJson ( new
908
- {
909
- Request = "Hello?"
910
- } )
911
- )
912
- . WithGuid ( guid3 )
913
- . RespondWith ( Response . Create ( ) ) ;
914
-
915
- server
916
- . Given (
917
- Request . Create ( )
918
- . WithPath ( "/users/post2" )
919
- . UsingPost ( )
920
- . WithBody ( new JsonMatcher ( new
921
- {
922
- city = "Amsterdam" ,
923
- country = "The Netherlands"
924
- } ) )
925
- )
926
- . WithGuid ( guid4 )
927
- . RespondWith ( Response . Create ( ) ) ;
928
-
929
927
server
930
928
. Given (
931
929
Request . Create ( )
@@ -960,30 +958,17 @@ public async Task IWireMockAdminApi_GetMappingsCode(MappingConverterType mapping
960
958
is
961
959
multiline
962
960
text
963
- " } )
964
- ) ;
965
-
966
- server
967
- . Given (
968
- Request . Create ( )
969
- . WithPath ( "/foo3" )
970
- . WithBody ( new JsonPartialMatcher ( new { a = 1 , b = 2 } ) )
971
- . UsingPost ( )
972
- )
973
- . WithGuid ( guid6 )
974
- . RespondWith (
975
- Response . Create ( )
976
- . WithStatusCode ( 200 )
977
- . WithBody ( "Line1\r \n Some \" value\" in Line2" )
961
+ "
962
+ } )
978
963
) ;
979
964
980
965
// Act
981
966
var api = RestClient . For < IWireMockAdminApi > ( server . Url ) ;
982
967
983
968
var mappings = await api . GetMappingsAsync ( ) . ConfigureAwait ( false ) ;
984
- mappings . Should ( ) . HaveCount ( 6 ) ;
969
+ mappings . Should ( ) . HaveCount ( 5 ) ;
985
970
986
- var code = await api . GetMappingsCodeAsync ( mappingConverterType ) . ConfigureAwait ( false ) ;
971
+ var code = await api . GetMappingsCodeAsync ( ) . ConfigureAwait ( false ) ;
987
972
988
973
// Assert
989
974
await Verifier . Verify ( code ) . DontScrubDateTimes ( ) . DontScrubGuids ( ) ;
0 commit comments