Frank.Testing.TestBases 1.7.0

There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package Frank.Testing.TestBases --version 1.7.0
NuGet\Install-Package Frank.Testing.TestBases -Version 1.7.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="Frank.Testing.TestBases" Version="1.7.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Frank.Testing.TestBases --version 1.7.0
#r "nuget: Frank.Testing.TestBases, 1.7.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 Frank.Testing.TestBases as a Cake Addin
#addin nuget:?package=Frank.Testing.TestBases&version=1.7.0

// Install Frank.Testing.TestBases as a Cake Tool
#tool nuget:?package=Frank.Testing.TestBases&version=1.7.0

Frank.Testing

A set of nugets to allow for easier testing of dotnet code using xUnit


GitHub License NuGet NuGet

GitHub contributors GitHub Release Date - Published_At GitHub last commit GitHub commit activity GitHub pull requests GitHub issues GitHub closed issues


Installation

NuGet

Install-Package Frank.Testing

.NET CLI

dotnet add package Frank.Testing

Usage

TestOutputHelperExtensions

using Xunit;
using Xunit.Abstractions;

public class MyTestClass
{
    private readonly ITestOutputHelper _outputHelper;

    public MyTestClass(ITestOutputHelper outputHelper)
    {
        _outputHelper = outputHelper;
    }

    [Fact]
    public void MyTestMethod()
    {
        _outputHelper.WriteLine(new { MyProperty = "MyValue" }); // Writes to test output as JSON: {"MyProperty":"MyValue"}
        _outputHelper.WriteJson(new { MyProperty = "MyValue" }); // Writes to test output as JSON: {"MyProperty":"MyValue"}
    }
    
    [Fact]
    public void MyTestMethod2()
    {
        _outputHelper.WriteCSharp(new { MyProperty = "MyValue" }); // Writes to test output as C#: var anonymousType = new { MyProperty = "MyValue" };
    }
    
    [Fact]
    public void MyTestMethod3()
    {
        _outputHelper.WriteXml(new MyClass() { Name = "MyName" }); // Writes to test output as XML: <MyClass><Name>MyName</Name></MyClass>
    }
}
Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  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. 
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.7.15-preview 77 3/4/2024
1.7.0 110 3/3/2024
1.6.14-preview 79 3/3/2024
1.6.0 136 1/29/2024
1.5.12-preview 58 1/29/2024