Hi
We are using the Owin Test Server in our codebase to run boundary tests against our API instance. We have the following line of code within a fixture, and the fixture is used across multiple tests. The tests are written using XBehave, which is backed by XUnit 2.
Code:
public TestServer Server { get; } = TestServer.Create<Startup>();
The Startup.cs is from our API project. This subsequently registers the routes, which causes the following exception:
Quote:System.ArgumentException: A route named 'Default' is already in the route collection. Route names must be unique.
Every single API test fails that uses this fixture, across 9 different test classes.
If I make the Server variable static within the fixture then this problem goes away, however everything I have read makes me feel this shouldn't even be happening?
Can someone give me some guidance about what might be causing this issue?
Cheers
Ant