You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I run the demo test project with Pactify library installed from NuGet, I'm getting this:
Demo.Test.Integration.Provider.Provider_Should_Meet_Consumers_Expectations
System.ArgumentNullException : Value cannot be null.
Parameter name: source
at System.Linq.Enumerable.TryGetFirst[TSource](IEnumerable`1 source, Func`2 predicate, Boolean& found)
at Pactify.Verifiers.HttpCouplingVerifier.VerifyAsync(HttpInteractionDefinition definition, PactDefinitionOptions options)
at Pactify.PactVerifier.VerifyAsync()
at Demo.Test.Integration.Provider.Provider_Should_Meet_Consumers_Expectations() in /***/Provider.cs:line 15
--- End of stack trace from previous location where exception was thrown ---
When I run the demo test having Pactify cloned from this repo as a reference project, I'm getting this:
Demo.Test.Integration.Provider.Provider_Should_Meet_Consumers_Expectations
Pactify.PactifyException : Expected response status code OK, but was NotFound
Expected response header content-Type was not present.
at Pactify.PactVerifier.VerifyAsync() in /***/Pactify/PactVerifier.cs:line 90
at Demo.Test.Integration.Provider.Provider_Should_Meet_Consumers_Expectations() in /***/Provider.cs:line 15
--- End of stack trace from previous location where exception was thrown ---
Source code for Consumer.cs:
usingSystem;usingSystem.IO;usingSystem.Net;usingSystem.Net.Http;usingSystem.Threading.Tasks;usingDemo.Test.Integration.Fixtures;usingPactify;usingXunit;namespaceDemo.Test.Integration{publicclassConsumer{[Fact]publicasyncTaskConsumer_Should_Create_A_Pact(){varoptions=newPactDefinitionOptions{IgnoreContractValues=true,IgnoreCasing=true};awaitPactMaker.Create(options).Between("orders","parcels").WithHttpInteraction(cb =>cb.Given("There is a parcel with some id").UponReceiving("A GET Request to retrieve the parcel").With( request =>request.WithMethod(HttpMethod.Get).WithPath("api/parcels/1")).WillRespondWith(response =>response.WithHeader("Content-Type","application/json").WithStatusCode(HttpStatusCode.OK).WithBody<ParcelReadModel>())).PublishedAsFile(System.IO.Path.Join((newDirectoryInfo(Environment.CurrentDirectory)).Parent.Parent.Parent.ToString(),"pacts")).MakeAsync();}}}
The source code for files ParcelReadModel.cs and Startup.cs is untouched, they are exactly as is here. I also tried with netcoreapp2.1 and 3.1, I'm getting exactly the same result.
Thanks!
The text was updated successfully, but these errors were encountered:
When I run the demo test project with Pactify library installed from NuGet, I'm getting this:
When I run the demo test having Pactify cloned from this repo as a reference project, I'm getting this:
Source code for
Consumer.cs
:Source code for
Provider.cs
:Project structure:
The source code for files
ParcelReadModel.cs
andStartup.cs
is untouched, they are exactly as is here. I also tried withnetcoreapp2.1
and3.1
, I'm getting exactly the same result.Thanks!
The text was updated successfully, but these errors were encountered: