Skip to content

vasylvd/xUnitV3LoadFramework

 
 

Repository files navigation

🚀 xUnitV3LoadFramework

NuGet Downloads

xUnitV3LoadFramework is a robust and user-friendly load testing framework built to seamlessly integrate with xUnit and powered by Akka.NET actors. It allows developers to efficiently define, execute, and analyze parallel load test scenarios, making load testing a natural part of your automated testing workflow.


🌟 Features

  • ✅ Easily define load test scenarios with intuitive attributes.
  • ✅ Parallel load test execution using Akka.NET actors.
  • ✅ Detailed aggregation and analysis of test results.
  • ✅ Fully integrated with xUnit testing framework.

⚡ Installation

Install via NuGet package manager:

dotnet add package xUnitV3LoadFramework

🚦 Quick Start

Defining a Load Test

Use the Load attribute (inheriting from FactAttribute) to configure concurrency level, duration, interval, and execution order.

Running Your Load Test

Execute your tests using the standard xUnit command:

dotnet test

📝 Usage Example

Here's a clear example demonstrating how to define and execute load tests using the Specification base class and the [Load] attribute:

using xUnitV3LoadFramework.Attributes;
using xUnitV3LoadFramework.Extensions;
using xUnitV3LoadFramework.Extensions.Framework;
using System;

[assembly: TestFramework(typeof(LoadTestFramework))]

namespace xUnitLoadDemo;

public class ExampleLoadSpecification : Specification
{
    protected override void EstablishContext()
    {
        Console.WriteLine(">> Setup phase");
    }

    protected override void Because()
    {
        Console.WriteLine(">> Action phase");
    }

    [Load(order: 1, concurrency: 2, duration: 5000, interval: 500)]
    public void should_run_load_scenario_1()
    {
        Console.WriteLine(">> Running Load 1");
    }

    [Load(order: 2, concurrency: 3, duration: 7000, interval: 300)]
    public void should_run_load_scenario_2()
    {
        Console.WriteLine(">> Running Load 2");
    }
}

Each [Load] attribute defines:

  • order: the test execution order
  • concurrency: number of parallel executions
  • duration: how long to run (in milliseconds)
  • interval: delay between each wave of execution (in milliseconds)

Run your tests using:

dotnet test

📖 Documentation

The documentation for xUnitV3LoadFramework is currently in progress. Stay tuned for updates!

In the meantime, you can explore the examples for practical use cases and refer to the source code for detailed insights.

Examples: examples


🤝 Contributing

Your contributions and feedback are always welcome!


📜 License

This project is licensed under the MIT License.


📫 Contact

For questions, suggestions, or feedback, please open an issue or contact directly:

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • C# 100.0%