@@ -25,7 +25,7 @@ public async Task ReturnsMismatchWhenNoGrpcClientRequestMade()
2525 // arrange
2626 var host = "0.0.0.0" ;
2727 var pact = NativeInterop . NewPact ( "grpc-greeter-client" , "grpc-greeter" ) ;
28- var interaction = NativeInterop . NewSyncMessageInteraction ( pact , "a request to a plugin" ) ;
28+ var interaction = PluginInterop . NewSyncMessageInteraction ( pact , "a request to a plugin" ) ;
2929 NativeInterop . WithSpecification ( pact , PactSpecification . V4 ) ;
3030 var content = $@ "{{
3131 ""pact:proto"":""{ Path . Join ( Directory . GetCurrentDirectory ( ) , ".." , ".." , ".." , ".." , "GrpcGreeterClient" , "Protos" , "greet.proto" ) . Replace ( "\\ " , "\\ \\ " ) } "",
@@ -38,10 +38,11 @@ public async Task ReturnsMismatchWhenNoGrpcClientRequestMade()
3838 ""message"": ""matching(type, 'Hello foo')""
3939 }}
4040 }}" ;
41- PluginInterop . PluginAdd ( pact , "protobuf" , "0.4.0" ) ;
41+
42+ using var pluginDriver = pact . UsePlugin ( "protobuf" , "0.4.0" ) ;
4243 PluginInterop . PluginInteractionContents ( interaction , 0 , "application/grpc" , content ) ;
4344
44- using var driver = MockServer . CreateMockServer ( pact , host , 0 , "grpc" , false ) ;
45+ using var driver = pact . CreateMockServer ( host , 0 , "grpc" , false ) ;
4546 var port = driver . Port ;
4647 testOutputHelper . WriteLine ( "Port: " + port ) ;
4748
@@ -58,7 +59,6 @@ public async Task ReturnsMismatchWhenNoGrpcClientRequestMade()
5859 ErrorString . Should ( ) . Be ( "Did not receive any requests for path 'Greeter/SayHello'" ) ;
5960 ExpectedPath . Should ( ) . Be ( "Greeter/SayHello" ) ;
6061
61- PluginInterop . PluginCleanup ( pact ) ;
6262 await Task . Delay ( 1 ) ;
6363 }
6464 [ Fact ]
@@ -67,7 +67,7 @@ public async Task WritesPactWhenGrpcClientRequestMade()
6767 // arrange
6868 var host = "0.0.0.0" ;
6969 var pact = NativeInterop . NewPact ( "grpc-greeter-client" , "grpc-greeter" ) ;
70- var interaction = NativeInterop . NewSyncMessageInteraction ( pact , "a request to a plugin" ) ;
70+ var interaction = PluginInterop . NewSyncMessageInteraction ( pact , "a request to a plugin" ) ;
7171 NativeInterop . WithSpecification ( pact , PactSpecification . V4 ) ;
7272 var content = $@ "{{
7373 ""pact:proto"":""{ Path . Join ( Directory . GetCurrentDirectory ( ) , ".." , ".." , ".." , ".." , "GrpcGreeterClient" , "Protos" , "greet.proto" ) . Replace ( "\\ " , "\\ \\ " ) } "",
@@ -81,10 +81,10 @@ public async Task WritesPactWhenGrpcClientRequestMade()
8181 }}
8282 }}" ;
8383
84- PluginInterop . PluginAdd ( pact , "protobuf" , "0.4.0" ) ;
84+ using var pluginDriver = pact . UsePlugin ( "protobuf" , "0.4.0" ) ;
8585 PluginInterop . PluginInteractionContents ( interaction , 0 , "application/grpc" , content ) ;
8686
87- using var driver = MockServer . CreateMockServer ( pact , host , 0 , "grpc" , false ) ;
87+ using var driver = pact . CreateMockServer ( host , 0 , "grpc" , false ) ;
8888 var port = driver . Port ;
8989 testOutputHelper . WriteLine ( "Port: " + port ) ;
9090
@@ -105,7 +105,6 @@ public async Task WritesPactWhenGrpcClientRequestMade()
105105 MismatchesString . Should ( ) . Be ( "[]" ) ;
106106
107107 PactFileWriter . WritePactFileForPort ( port , "../../../../pacts" ) ;
108- PluginInterop . PluginCleanup ( pact ) ;
109108 }
110109
111110 }
0 commit comments