E13.Common.Nunit
2025.117.22
dotnet add package E13.Common.Nunit --version 2025.117.22
NuGet\Install-Package E13.Common.Nunit -Version 2025.117.22
<PackageReference Include="E13.Common.Nunit" Version="2025.117.22" />
<PackageVersion Include="E13.Common.Nunit" Version="2025.117.22" />
<PackageReference Include="E13.Common.Nunit" />
paket add E13.Common.Nunit --version 2025.117.22
#r "nuget: E13.Common.Nunit, 2025.117.22"
#:package E13.Common.Nunit@2025.117.22
#addin nuget:?package=E13.Common.Nunit&version=2025.117.22
#tool nuget:?package=E13.Common.Nunit&version=2025.117.22
E13.Common.Nunit
Overview
E13.Common.Nunit is a package within the E13.Common collection designed to enhance NUnit testing capabilities. It provides custom attributes, extensions, and utilities to streamline test development and improve test organization for projects using the NUnit testing framework.
Features
- Custom Test Attributes: Specialized attributes for categorizing and controlling test execution
IntegrationAttribute: For marking integration tests that should be skipped in in-memory modeRegressionAttribute: For categorizing regression testsSmokeAttribute: For categorizing smoke tests
- Environment Handling: Utilities for managing environment variables during tests
- String Extensions: Helper methods for working with paths and directories in tests
- FluentAssertions Integration: Pre-configured integration with FluentAssertions
Installation
dotnet add package E13.Common.Nunit
Usage
Using Custom Test Attributes
using E13.Common.Nunit;
using NUnit.Framework;
public class MyTests
{
[Test]
[Smoke]
public void BasicFunctionality_ShouldWork()
{
// This test will be categorized as a smoke test
// Useful for running only smoke tests: dotnet test --filter Category=Smoke
}
[Test]
[Regression]
public void FixedBug_ShouldNotReoccur()
{
// This test will be categorized as a regression test
// Useful for running only regression tests: dotnet test --filter Category=Regression
}
[Test]
[Integration]
public void DatabaseConnection_ShouldWork()
{
// This test will be skipped if running in in-memory mode
// Useful for tests that require external resources
}
}
Using String Extensions
using System;
using E13.Common.Nunit;
using NUnit.Framework;
public class PathTests
{
[Test]
public void FindParentDirectory()
{
var currentDir = Directory.GetCurrentDirectory();
// Find a parent directory by name
var projectDir = currentDir.ParentDirectory("MyProject");
// Use the project directory for test file operations
var testFilePath = Path.Combine(projectDir, "TestData", "sample.json");
}
}
Dependencies
- .NET 9.0
- NUnit
- FluentAssertions
- Newtonsoft.Json
- E13.Common.Core
Related Packages
E13.Common.Nunit is part of the E13.Common collection, which includes:
- E13.Common.Core - Core utilities and base classes
- E13.Common.Nunit.Api - NUnit utilities for API testing
- E13.Common.Nunit.UI - NUnit utilities for UI testing
- E13.Common.Domain - Domain layer components
- E13.Common.Data.Db - Database access components
Contributing
Contributions to E13.Common.Nunit are welcome. If you have suggestions or improvements, please submit an issue or create a pull request in the GitHub repository.
License
This project is licensed under the MIT License. For more details, see the LICENSE file in the repository.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net9.0
- E13.Common.Core (>= 2025.114.21)
- FluentAssertions (>= 8.2.0)
- Newtonsoft.Json (>= 13.0.3)
- nunit (>= 4.3.2)
- System.Drawing.Common (>= 9.0.3)
NuGet packages (2)
Showing the top 2 NuGet packages that depend on E13.Common.Nunit:
| Package | Downloads |
|---|---|
|
E13.Common.Nunit.Api
Common package containing helpers for an Nunit based testing project targeting an Api layer |
|
|
E13.Common.Nunit.UI
Common package containing helpers for an Nunit based testing project for a front end |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 2025.117.22 | 197 | 4/27/2025 |
| 2025.114.21 | 274 | 4/24/2025 |
| 2025.114.20 | 256 | 4/24/2025 |
| 2025.114.19 | 256 | 4/24/2025 |
| 2025.114.18 | 246 | 4/24/2025 |
| 2025.112.17 | 270 | 4/22/2025 |
| 2025.112.16 | 276 | 4/22/2025 |
| 2025.111.15 | 275 | 4/21/2025 |
| 2025.106.14 | 295 | 4/16/2025 |
| 2025.106.12 | 320 | 4/16/2025 |
| 2025.97.11 | 312 | 4/7/2025 |
| 2025.97.10 | 247 | 4/7/2025 |
| 2025.96.9 | 249 | 4/6/2025 |
| 2025.96.8 | 275 | 4/6/2025 |
| 2025.91.7 | 275 | 4/1/2025 |
| 2025.91.6 | 263 | 4/1/2025 |
| 2025.90.4 | 313 | 3/31/2025 |
| 2023.30.1 | 506 | 1/30/2023 |
| 2023.18.1 | 504 | 1/18/2023 |
| 1.0.0 | 238 | 4/1/2025 |