Kabua.TypeSafe.xUnit 1.0.0

The ID prefix of this package has been reserved for one of the owners of this package by NuGet.org. Prefix Reserved
dotnet add package Kabua.TypeSafe.xUnit --version 1.0.0
NuGet\Install-Package Kabua.TypeSafe.xUnit -Version 1.0.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Kabua.TypeSafe.xUnit" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Kabua.TypeSafe.xUnit --version 1.0.0
#r "nuget: Kabua.TypeSafe.xUnit, 1.0.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Kabua.TypeSafe.xUnit as a Cake Addin
#addin nuget:?package=Kabua.TypeSafe.xUnit&version=1.0.0

// Install Kabua.TypeSafe.xUnit as a Cake Tool
#tool nuget:?package=Kabua.TypeSafe.xUnit&version=1.0.0

Logo

Type Safe xUnit

A Type Safe Data-Driven Extension for xUnit.net

Goal

The following goals were the inspiration behind this project's creation:

  1. Make unit testing a 1st-class citizen by using type-safe data-driven objects.
  2. To make xUnit data-driven features type safe, easy to use, and flexible, by employing real POCO objects.
  3. To make it easier to develop your own type-safe data-driven xUnit attributes, albeit not required.
  4. To make it easy to alter the test's display text on a global and per-test basis.
  5. To ensure that the sequence in which the data-driven tests were created corresponds to the order in which they are shown in the Test Runner.

Getting Started

First, the Kabua.TypeSafe.xUnit project supports both .net461 and .net6 and above.

Second, the easiest way to get started is to use the nuget packages from nuget.org.

Building the Code

These instructions will get a copy of the project up and running on your local machine for development and testing purposes.

Prerequisites

No installation is required. Even though this project references the xunit.assert and xunit.core nuget packages.

Installing and running the tests

  1. clone from GitHub
  2. open a CLI
  3. navigate to the Kabua.TypeSafe.xUnit.UnitTests project.
  4. run dotnet test. This will build the solution and then run all the xUnit tests.
Example

From the command prompt.

c:>mkdir temp\Kabua.TypeSafe.xUnit
c:>cd temp\Kabua.TypeSafe.xUnit
c:\temp\Kabua.TypeSafe.xUnit>git clone https://github.com/kabua/typesafe.xunit.git
c:\temp\Kabua.TypeSafe.xUnit>cd TypeSafe.xUnit\Kabua.TypeSafe.xUnit.UnitTests
c:\temp\Kabua.TypeSafe.xUnit\TypeSafe.xUnit\Kabua.TypeSafe.xUnit.UnitTests>dotnet test

Deployment

The Kabua.TypeSafe.xUnit project supports both .net4.61 and .net6 and above. The package is release on www.nuget.org

How to use

The Kabua.TypeSafe.xUnit.UnitTests contains over 50 examples on how to use the rich type-safe data-driven attributes for xUnit.

How the Unit Test Examples Are Structured

To learn how to utilize these new type-safe data-driven attributes, read the examples from the first source file to the last. As concepts in later files build on earlier ones.

To improve readability, we format files as follows:

  • Prefixed files with F0x_ (e.g., F01_ to F07_) and include a descriptive name.
  • Files can include many classes. Class names begin with CXY_, where X is the file number, and Y in a numbered class. For example: C32_, indicates the second class in the third file.
  • To aid with Test Runner formatting, we prefix all tests with T0x_, such as T01_, T02_, etc.

Contributing

Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.

Versioning

We use SemVer for versioning. For the versions available, see the tags on this repository.

Authors

  • Tristen Fielding - Initial author - Kabua
  • Billie Thompson - Initial README work - PurpleBooth

See also the list of contributors who participated in this project.

License

This project is licensed under the MIT License so that everyone can use it - see the LICENSE file for details.

Acknowledgments

  • Hat tip to anyone whose code was used
  • Inspiration
  • etc
Product 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. 
.NET Framework net462 is compatible.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.0 197 11/29/2023

This is the initial release of the type safe extentions to xunit, including over 50 unit tests showing how to use these new features.