pact-foundation / pact-net

.NET version of Pact. Enables consumer driven contract testing, providing a mock service and DSL for the consumer project, and interaction playback and verification for the service provider project.
https://pact.io
MIT License
823 stars 225 forks source link

'object' does not contain a definition for 'WillRespond' #472

Closed tma2023 closed 10 months ago

tma2023 commented 10 months ago

I'm writing contract test for PUT request with a request body, followed the source code unit test example, but failed

---------code--------------- _fixture.PactBuilder.UponReceiving("A PUT request to group api with existing id returns NoContent") .WithRequest(HttpMethod.Put, _fixture.DaprClientInvokeServiceBaseEndpoint + "/" + methodName) .WithJsonBody(Pactflow.Match.Type(groupObj)) .WillRespond() .WithStatus(HttpStatusCode.NoContent);

---------unit test error message-------------- Message:  Microsoft.CSharp.RuntimeBinder.RuntimeBinderException : 'object' does not contain a definition for 'WillRespond'

Stack Trace:  CallSite.Target(Closure, CallSite, Object) UpdateDelegates.UpdateAndExecute1[T0,TRet](CallSite site, T0 arg0) GroupApiContractTests.UpdateAsync_Exists_InGroup_NoContent() line 213 --- End of stack trace from previous location ---

------------nuget package version--------------------- PactNet 5.0.0-beta.1 PactNet.Abstractions 5.0.0-beta.1 PactNet.Output.Xunit 1.0.0