pact-foundation / pact-workshop-dotnet-core-v1

A workshop for Pact using .NET Core
Apache License 2.0
75 stars 208 forks source link

Error while running dotnet test command #10

Open akankshamh opened 5 years ago

akankshamh commented 5 years ago

Getting below error while running dotnet test command for consumer tests

D:\pact-workshop-dotnet-core-v1-master\pact-workshop-dotnet-core-v1-master\YourSolution\Consumer\tests>dotnet test Build started, please wait... Build completed.

Test run for D:\pact-workshop-dotnet-core-v1-master\pact-workshop-dotnet-core-v1-master\YourSolution\Consumer\tests\bin\Debug\netcoreapp2.2\tests.dll(.NETCoreApp,Version=v2.2) Microsoft (R) Test Execution Command Line Tool Version 15.9.0 Copyright (c) Microsoft Corporation. All rights reserved.

Starting test execution, please wait... [xUnit.net 00:00:59.94] tests.ConsumerPactTests.ItHandlesInvalidDateParam [FAIL] Failed tests.ConsumerPactTests.ItHandlesInvalidDateParam Error Message: System.AggregateException : One or more errors occurred. (One or more errors occurred. (No connection could be made because the target machine actively refused it)) (The following constructor parameters did not have matching fixture data: ConsumerPactClassFixture fixture) ---- System.AggregateException : One or more errors occurred. (No connection could be made because the target machine actively refused it) -------- System.Net.Http.HttpRequestException : No connection could be made because the target machine actively refused it ------------ System.Net.Sockets.SocketException : No connection could be made because the target machine actively refused it ---- The following constructor parameters did not have matching fixture data: ConsumerPactClassFixture fixture Stack Trace:

----- Inner Stack Trace #1 (System.AggregateException) ----- at PactNet.Mocks.MockHttpService.Host.RubyHttpHost.Start() in C:\projects\pact-net\PactNet\Mocks\MockHttpService\Host\RubyHttpHost.cs:line 65 at PactNet.PactBuilder.MockService(Int32 port, JsonSerializerSettings jsonSerializerSettings, Boolean enableSsl, IPAddress host) in C:\projects\pact-net\PactNet\PactBuilder.cs:line 88 at PactNet.PactBuilder.MockService(Int32 port, Boolean enableSsl, IPAddress host) in C:\projects\pact-net\PactNet\PactBuilder.cs:line 59 at tests.ConsumerPactClassFixture..ctor() in D:\pact-workshop-dotnet-core-v1-master\pact-workshop-dotnet-core-v1-master\YourSolution\Consumer\tests\ConsumerPactClassFixture.cs:line 39 ----- Inner Stack Trace ----- at System.Net.Http.ConnectHelper.ConnectAsync(String host, Int32 port, CancellationToken cancellationToken) at System.Threading.Tasks.ValueTask1.get_Result() at System.Net.Http.HttpConnectionPool.CreateConnectionAsync(HttpRequestMessage request, CancellationToken cancellationToken) at System.Threading.Tasks.ValueTask1.get_Result() at System.Net.Http.HttpConnectionPool.WaitForCreatedConnectionAsync(ValueTask1 creationTask) at System.Threading.Tasks.ValueTask1.get_Result() at System.Net.Http.HttpConnectionPool.SendWithRetryAsync(HttpRequestMessage request, Boolean doRequestAuth, CancellationToken cancellationToken) at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) at System.Net.Http.HttpClient.FinishSendAsyncBuffered(Task`1 sendTask, HttpRequestMessage request, CancellationTokenSource cts, Boolean disposeCts) ----- Inner Stack Trace ----- at System.Net.Http.ConnectHelper.ConnectAsync(String host, Int32 port, CancellationToken cancellationToken) ----- Inner Stack Trace #2 (Xunit.Sdk.TestClassException) -----

Total tests: 1. Passed: 0. Failed: 1. Skipped: 0. Test Run Failed. Test execution time: 1.0123 Minutes

D:\pact-workshop-dotnet-core-v1-master\pact-workshop-dotnet-core-v1-master\YourSolution\Consumer\tests>dotnet test Build started, please wait... Build completed.

Test run for D:\pact-workshop-dotnet-core-v1-master\pact-workshop-dotnet-core-v1-master\YourSolution\Consumer\tests\bin\Debug\netcoreapp2.2\tests.dll(.NETCoreApp,Version=v2.2) Microsoft (R) Test Execution Command Line Tool Version 15.9.0 Copyright (c) Microsoft Corporation. All rights reserved.

Starting test execution, please wait... [xUnit.net 00:01:01.12] tests.ConsumerPactTests.ItHandlesInvalidDateParam [FAIL] Failed tests.ConsumerPactTests.ItHandlesInvalidDateParam Error Message: System.AggregateException : One or more errors occurred. (One or more errors occurred. (No connection could be made because the target machine actively refused it)) (The following constructor parameters did not have matching fixture data: ConsumerPactClassFixture fixture) ---- System.AggregateException : One or more errors occurred. (No connection could be made because the target machine actively refused it) -------- System.Net.Http.HttpRequestException : No connection could be made because the target machine actively refused it ------------ System.Net.Sockets.SocketException : No connection could be made because the target machine actively refused it ---- The following constructor parameters did not have matching fixture data: ConsumerPactClassFixture fixture Stack Trace:

----- Inner Stack Trace #1 (System.AggregateException) ----- at PactNet.Mocks.MockHttpService.Host.RubyHttpHost.Start() in C:\projects\pact-net\PactNet\Mocks\MockHttpService\Host\RubyHttpHost.cs:line 65 at PactNet.PactBuilder.MockService(Int32 port, JsonSerializerSettings jsonSerializerSettings, Boolean enableSsl, IPAddress host) in C:\projects\pact-net\PactNet\PactBuilder.cs:line 88 at PactNet.PactBuilder.MockService(Int32 port, Boolean enableSsl, IPAddress host) in C:\projects\pact-net\PactNet\PactBuilder.cs:line 59 at tests.ConsumerPactClassFixture..ctor() in D:\pact-workshop-dotnet-core-v1-master\pact-workshop-dotnet-core-v1-master\YourSolution\Consumer\tests\ConsumerPactClassFixture.cs:line 39 ----- Inner Stack Trace ----- at System.Net.Http.ConnectHelper.ConnectAsync(String host, Int32 port, CancellationToken cancellationToken) at System.Threading.Tasks.ValueTask1.get_Result() at System.Net.Http.HttpConnectionPool.CreateConnectionAsync(HttpRequestMessage request, CancellationToken cancellationToken) at System.Threading.Tasks.ValueTask1.get_Result() at System.Net.Http.HttpConnectionPool.WaitForCreatedConnectionAsync(ValueTask1 creationTask) at System.Threading.Tasks.ValueTask1.get_Result() at System.Net.Http.HttpConnectionPool.SendWithRetryAsync(HttpRequestMessage request, Boolean doRequestAuth, CancellationToken cancellationToken) at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) at System.Net.Http.HttpClient.FinishSendAsyncBuffered(Task`1 sendTask, HttpRequestMessage request, CancellationTokenSource cts, Boolean disposeCts) ----- Inner Stack Trace ----- at System.Net.Http.ConnectHelper.ConnectAsync(String host, Int32 port, CancellationToken cancellationToken) ----- Inner Stack Trace #2 (Xunit.Sdk.TestClassException) -----

Total tests: 1. Passed: 0. Failed: 1. Skipped: 0. Test Run Failed. Test execution time: 1.0320 Minutes

D:\pact-workshop-dotnet-core-v1-master\pact-workshop-dotnet-core-v1-master\YourSolution\Consumer\tests>dotnet test Build started, please wait... Build completed.

Test run for D:\pact-workshop-dotnet-core-v1-master\pact-workshop-dotnet-core-v1-master\YourSolution\Consumer\tests\bin\Debug\netcoreapp2.2\tests.dll(.NETCoreApp,Version=v2.2) Microsoft (R) Test Execution Command Line Tool Version 15.9.0 Copyright (c) Microsoft Corporation. All rights reserved.

Starting test execution, please wait... [xUnit.net 00:01:01.09] tests.ConsumerPactTests.ItHandlesInvalidDateParam [FAIL] Failed tests.ConsumerPactTests.ItHandlesInvalidDateParam Error Message: System.AggregateException : One or more errors occurred. (One or more errors occurred. (No connection could be made because the target machine actively refused it)) (The following constructor parameters did not have matching fixture data: ConsumerPactClassFixture fixture) ---- System.AggregateException : One or more errors occurred. (No connection could be made because the target machine actively refused it) -------- System.Net.Http.HttpRequestException : No connection could be made because the target machine actively refused it ------------ System.Net.Sockets.SocketException : No connection could be made because the target machine actively refused it ---- The following constructor parameters did not have matching fixture data: ConsumerPactClassFixture fixture Stack Trace:

----- Inner Stack Trace #1 (System.AggregateException) ----- at PactNet.Mocks.MockHttpService.Host.RubyHttpHost.Start() in C:\projects\pact-net\PactNet\Mocks\MockHttpService\Host\RubyHttpHost.cs:line 65 at PactNet.PactBuilder.MockService(Int32 port, JsonSerializerSettings jsonSerializerSettings, Boolean enableSsl, IPAddress host) in C:\projects\pact-net\PactNet\PactBuilder.cs:line 88 at PactNet.PactBuilder.MockService(Int32 port, Boolean enableSsl, IPAddress host) in C:\projects\pact-net\PactNet\PactBuilder.cs:line 59 at tests.ConsumerPactClassFixture..ctor() in D:\pact-workshop-dotnet-core-v1-master\pact-workshop-dotnet-core-v1-master\YourSolution\Consumer\tests\ConsumerPactClassFixture.cs:line 39 ----- Inner Stack Trace ----- at System.Net.Http.ConnectHelper.ConnectAsync(String host, Int32 port, CancellationToken cancellationToken) at System.Threading.Tasks.ValueTask1.get_Result() at System.Net.Http.HttpConnectionPool.CreateConnectionAsync(HttpRequestMessage request, CancellationToken cancellationToken) at System.Threading.Tasks.ValueTask1.get_Result() at System.Net.Http.HttpConnectionPool.WaitForCreatedConnectionAsync(ValueTask1 creationTask) at System.Threading.Tasks.ValueTask1.get_Result() at System.Net.Http.HttpConnectionPool.SendWithRetryAsync(HttpRequestMessage request, Boolean doRequestAuth, CancellationToken cancellationToken) at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) at System.Net.Http.HttpClient.FinishSendAsyncBuffered(Task`1 sendTask, HttpRequestMessage request, CancellationTokenSource cts, Boolean disposeCts) ----- Inner Stack Trace ----- at System.Net.Http.ConnectHelper.ConnectAsync(String host, Int32 port, CancellationToken cancellationToken) ----- Inner Stack Trace #2 (Xunit.Sdk.TestClassException) -----

Total tests: 1. Passed: 0. Failed: 1. Skipped: 0. Test Run Failed. Test execution time: 1.0311 Minutes

DennisJantos commented 5 years ago

I have got the same issue

LyubenBobchev commented 5 years ago

I have followed this workshop word for word and I get the error as well. What is the cause of this ?