Markop Test is an open-source testing toolkit for ASP.NET applications. It provides reusable factories to build unit, integration, functional, and load tests on top of xUnit with minimal boilerplate.
- Reduces setup code for web-hosted tests
- Supports endpoint-oriented integration testing
- Enables scenario-style functional tests
- Generates HTML reports for load testing
- Integrates with standard xUnit workflows
Markop Test currently targets:
.NET 8.NET 9.NET 10
Install from NuGet in your test project:
Install-Package MarkopTestOr with the .NET CLI:
dotnet add package MarkopTest- Create a test project (class library or xUnit project).
- Add a reference to the application project you want to test.
- Install
MarkopTest. - Create an
AppFactoryclass that inherits one of the test factories. - Write tests by inheriting from your
AppFactory.
Example project creation:
dotnet new classlib -n IntegrationTest
dotnet sln add IntegrationTest
dotnet add IntegrationTest package MarkopTestEach test style has a factory base class:
UnitTestFactory<TStartup>IntegrationTestFactory<TStartup, TFetchOptions>FunctionalTestFactory<TStartup>LoadTestFactory<TStartup>
You typically override these members:
Initializer(IServiceProvider hostServices)to seed data and prepare test stateConfigureTestServices(IServiceCollection services)to replace or mock dependenciesGetUrl(string url, string controllerName, string testMethodName)for integration/load routingValidateResponse(HttpResponseMessage response, TFetchOptions options)for integration assertions
Use [Endpoint("...")] on test classes or methods. Markop Test replaces:
[controller]with test class name (suffixes likeTest,Tests, andControllerare removed)[action]with the current test method name
Use UnitTestFactory when testing isolated application behavior while still having host and DI access.
Use IntegrationTestFactory to send HTTP requests to your in-memory test server and validate full pipeline behavior.
Use FunctionalTestFactory for end-to-end business scenarios composed of multiple integration-level actions.
Use LoadTestFactory to execute synchronous and asynchronous request batches and export performance reports to LoadTestResult/....
The sample/ directory demonstrates real usage:
sample/test/UnitTestsample/test/IntegrationTestsample/test/FunctionalTestsample/test/LoadTest
Run sample tests:
dotnet test sample/test/UnitTest/UnitTest.csproj
dotnet test sample/test/IntegrationTest/IntegrationTest.csproj
dotnet test sample/test/FunctionalTest/FunctionalTest.csproj
dotnet test sample/test/LoadTest/LoadTest.csprojContributions are welcome. Please open an issue or pull request describing the problem, proposed solution, and test coverage.
This project is licensed under the MIT License.