TimeWarp.Fixie
1.0.0
Prefix Reserved
See the version list below for details.
dotnet add package TimeWarp.Fixie --version 1.0.0
NuGet\Install-Package TimeWarp.Fixie -Version 1.0.0
<PackageReference Include="TimeWarp.Fixie" Version="1.0.0" />
paket add TimeWarp.Fixie --version 1.0.0
#r "nuget: TimeWarp.Fixie, 1.0.0"
// Install TimeWarp.Fixie as a Cake Addin #addin nuget:?package=TimeWarp.Fixie&version=1.0.0 // Install TimeWarp.Fixie as a Cake Tool #tool nuget:?package=TimeWarp.Fixie&version=1.0.0
timewarp-fixie
The TimeWarp Fixie testing convention.
Give a Star! ⭐
If you like or are using this project please give it a star. Thank you!
Installation
You can see the latest NuGet packages from the official TimeWarp NuGet page.
Usage
Create a new test project.
dotnet new classlib -n MyProject.Tests
Add Nugets to the project
dotnet add package TimeWarp.Fixie
dotnet add package Fixie.TestAdapter --version 3.2.0
Create a dotnet tool manifest.
dotnet new tool-manifest
Add Fixie.Console to the manifest
dotnet tool install Fixie.Console
Inside your fixie project create a class that inherits from Fixie.Conventions.TestConvention
class TestProject : TimeWarp.Fixie.TestingConvention { }
This will then use the TimeWarp.Fixie convention.
Create a sample test. First we will add FluentAssertions you could use basic Asserts or any other assertion library.
dotnet add package FluentAssertions --version 6.7.0
Create a sample test case.
namespace ConventionTest_;
using FluentAssertions;
using TimeWarp.Fixie;
[TestTag(TestTags.Fast)]
public class SimpleNoApplicationTest_Should_
{
public static void AlwaysPass() => true.Should().BeTrue();
[Skip("Demonstrates skip attribute")]
public static void SkipExample() => true.Should().BeFalse();
[TestTag(TestTags.Fast)]
public static void TagExample() => true.Should().BeTrue();
[Input(5, 3, 2)]
[Input(8, 5, 3)]
public static void Subtract(int aX, int aY, int aExpectedDifference)
{
int result = aX - aY;
result.Should().Be(aExpectedDifference);
}
}
Execute the tests:
dotnet fixie
How to filter tests by Name
From fixie docs
The optional argument --tests
(abbreviated -t
) lets you specify which tests to run.
A full test name match will run that single test:
dotnet fixie MyTestProject --tests Full.Namespace.MyTestClass.MyTestMethod
To avoid having to type the full namespace or method name, there is an implicit wildcard at the start and end of the pattern. Here we run an entire test class:
dotnet fixie MyTestProject --tests MyTestClass
There is an implicit lowercase letter wildcard, whenever a capital letter is followed by a non-lowercase character. In other words, you can type "MTC" to match "MyTestClass". Here we run a select few related tests within that class:
dotnet fixie MyTestProject --tests MTC.ShouldValidateThat
Although unnecessary in most realistic cases, an explicit *
wildcard will match any sequence of zero or more characters:
dotnet fixie MyTestProject --tests MTC.*Validate
When all tests are run by omitting the --tests
argument, passing tests are omitted for brevity. However, because a --tests
pattern may in fact be more inclusive than the developer intended, the console output will include passing test names in addition to other test results as feedback whenever this argument is used.
How to filter tests by Tags
If you want to only run tests with a given tag/s you can do this by passing in the --Tag
parameter after --
.
If you want to run more than one Tag pass the parameter multiple times.
Examples:
dotnet fixie --no-build -- --Tag Fast --Tag Smoke
dotnet fixie -- --Tag Smoke
Unlicense
Contributing
Time is of the essence. Before developing a Pull Request I recommend opening a discussion.
Please feel free to make suggestions and help out with the documentation. Please refer to Markdown for how to write markdown files.
Contact
Sometimes the github notifications get lost in the shuffle. If you file an issue and don't get a response in a timely manner feel free to ping on our Discord server.
References
https://github.com/fixie/fixie
Commands used
dotnet new sln
dotnet new classlib -n timewarp-fixie
dotnet new classlib -n TimeWarp.Fixie.Tests
dotnet sln add .\source\timewarp-fixie\timewarp-fixie.csproj
dotnet new tool-manifest
dotnet tool install dotnet-cleanup
dotnet tool install Fixie.Console
dotnet cleanup -y
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
-
net6.0
- Fixie (>= 3.2.0)
- Fixie.TestAdapter (>= 3.2.0)
- Microsoft.Extensions.DependencyInjection (>= 6.0.1)
- Scrutor (>= 4.2.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories (1)
Showing the top 1 popular GitHub repositories that depend on TimeWarp.Fixie:
Repository | Stars |
---|---|
TimeWarpEngineering/timewarp-state
A Blazor State management library by TimeWarp.
|
Version | Downloads | Last updated |
---|---|---|
2.0.0 | 208 | 8/11/2024 |
1.0.2 | 1,356 | 11/26/2022 |
1.0.1 | 529 | 10/26/2022 |
1.0.0 | 379 | 10/26/2022 |
1.0.0-alpha.2 | 108 | 10/6/2022 |
1.0.0-alpha.1 | 141 | 8/19/2022 |
1.0.0-alpha.0 | 129 | 8/1/2022 |