Questions tagged [testserver]
21 questions
4
votes
0 answers
Logging into 'Test Servers' failed
I've tried to login to Telegram Test Servers according to the library's documentation , to avoid polluting my original account while testing my code, using the…

IPEN
- 41
- 2
4
votes
0 answers
Is there a way to call TestServer using only Httpclient without using TestServer.GetTestClient()?
I have built a unit test project in .NET Core 5.0 to test my API's. I have created a test server using HostBuilder. In my unit testing class I am calling an API using
HttpClient client;
client = TestServer.GetTestClient(); in all methods. It'…

Sudhir Kumbhare
- 51
- 3
2
votes
0 answers
Using full Kestrel server instead of the test server?
While using the test server from the Microsoft.AspNetCore.Mvc.Testing package with code like this
var webAppFactory = new WebApplicationFactory();
var httpClient = webAppFactory.CreateClient();
I noticed that this is not using a Kestrel…

stefan.at.kotlin
- 15,347
- 38
- 147
- 270
2
votes
2 answers
Integration test with Hotchocolate GraphQL and TestServer in C#
I have an ASP.NET Core Api (.NET 6.0) with REST- and GraphQL-endpoints. The GraphQL-endpoints are implemented with Hotchocolate (12.6.0).
For testing the REST endpoints I create a TestServer like this:
protected static async Task…

MatterOfFact
- 1,253
- 2
- 18
- 49
2
votes
1 answer
XUnit Integration Testing with Identityserver: Token received from Identityserver is unable to match key
I'm currently trying to implement Integration Testing in an environment with 2 servers:
A .NET Core API server
An IdentityServer4 Authentication Server
Through much struggle, I've managed to get the two to communicate with eachother, however,…

Sir Ayme
- 41
- 2
1
vote
0 answers
Using multiple TestServer instances share the server address from HttpClient
I am trying to build a test integration suite with Microsoft's TestServer class to test two dotnet web REST API services based on current dotnet 7 SDK in a single XUnit test.
For the sake of better understanding the issue let's call the services…

Vedran Mandić
- 1,084
- 11
- 21
1
vote
0 answers
How to mock authentication in .Net core using TestServer / Specflow
I have a .net 7 api that i tried to test cover using Specflow/xUnit but i cannot seem to mock the authentication for my api.
I always receive Unauthorized on my authenticated endpoints.
The .net 7 api is using the following program.cs :
public…

Nicolas G.
- 33
- 1
- 4
1
vote
0 answers
Starting Test Server in Memory to test Razor Pages with Playwright
My objective is to start Playwright in memory and run some end to end tests against a in-memory test server.
I've forked Jonathan's great repo which demonstrates exactly what I want to do, however it's using .Net core 3.1 and a MVC project which…

ca53rlb
- 77
- 5
1
vote
0 answers
Integration test when API calling another API
I have two APIs on same solution.
Let's call them API-1 and API-2.
API-1 calculate something, one of the variables is got from the API-2 by a http client get.
When I was writing the integration test for the API, I do a new instance of TestServer for…

Cezar K.
- 11
- 1
1
vote
1 answer
Calling thirdparty container with .net core TestHost/TestServer via SSL: Bypass SSL Validation using Testservers CreateClient() method
I am trying to add keycloak as a testcontainer to my .net core (5) integration tests using the dotnet-testcontainers library .
My Problem is, I am struggling with HTTPS-Support having a container using self-signed certificates and TestServer-Class…

Dominik
- 2,801
- 2
- 33
- 45
1
vote
2 answers
How to use Service Fabric service with AspNet Core WebApi and Autofac and run TestServer
I can't figure out how to use an AspNet Core 3.1 Web Api with Service Fabric and Autofac, and also how to have it ready for a TestServer to run for integration/functional testing.
The documentation is very incomplete.
Autofac documentation shows how…

diegosasw
- 13,734
- 16
- 95
- 159
0
votes
0 answers
Django Server stuck after updating from python 3.9 to python 3.10 (using Django 4.1.5)
After upgrading python 3.9 to 3.10 the Django Server isn't working locally anymore (I'm using the Django Server Plugin for Pycharm). In my gitlab pipeline it seems to work allright.
Below you can see further details (click link to see…

Carlotta Fabian
- 1
- 2
0
votes
0 answers
Selenium Integration Testing WebApplicationFactory
I got exception when tried Selenium Integration test.
OpenQA.Selenium.WebDriverException
unknown error: net::ERR_CONNECTION_REFUSED
(Session info: headless MicrosoftEdge=108.0.1462.54)
at OpenQA.Selenium.WebDriver.UnpackAndThrowOnError(Response…

Kannan Chithamabaranathan
- 29
- 1
- 6
0
votes
1 answer
.Net Framework 4.6.1 MVC integration testing
I am having a hard time trying to find sources of how can I run Integration Tests on my old Net Framework 4.6.1 MVC application. I tried a lot of guides I found, but none of them works for one reason or another.
My application is way to big to…

Hebert Ferreira
- 1
- 1
0
votes
1 answer
Calling another controller on same server using HttpClient fails when using TestServer
I have a core Server project that uses:
services.AddControllers()
.AddApplicationPart(gatewayAssembly)
.AddApplicationPart(identitiesMicroserviceAssembly)
.AddApplicationPart(exceptionsMicroserviceAssembly)
.etc ...;
The controllers…

Neil W
- 7,670
- 3
- 28
- 41