Knyaz.NUnit.AssertExpressions 1.0.0

NUnit extension for the objects verification.

Install-Package Knyaz.NUnit.AssertExpressions -Version 1.0.0
dotnet add package Knyaz.NUnit.AssertExpressions --version 1.0.0
<PackageReference Include="Knyaz.NUnit.AssertExpressions" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Knyaz.NUnit.AssertExpressions --version 1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Knyaz.NUnit.AssertExpressions, 1.0.0"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. Copy this into the interactive tool or source code of the script to reference the package.
// Install Knyaz.NUnit.AssertExpressions as a Cake Addin
#addin nuget:?package=Knyaz.NUnit.AssertExpressions&version=1.0.0

// Install Knyaz.NUnit.AssertExpressions as a Cake Tool
#tool nuget:?package=Knyaz.NUnit.AssertExpressions&version=1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

About Knyaz.NUnit.AssertExpressions

The library simplifies unit tests assertion block. See the example below:

Say you have the Point class to be tested

class Point
{
    public int X {get;}
    public int Y {get;}
    public Point(x, y)
    {
        X = x;
        Y = x; //<- bug here
    }
}

and you want to test the constructor. Lets see how it will:

using NUnit.Framework;
using Knyaz.NUnit.AssertExpressions;

[TestFixture]
public class PointTests
{
    [Test]
    public static void ConstructorCreatesPoint() =>
        new Point(5, 6).Assert(point => point.X == 5 && point.Y == 6);
}

When you run the test you will see the message:

point.Y
  Expected: 6
  But was:  5

About Knyaz.NUnit.AssertExpressions

The library simplifies unit tests assertion block. See the example below:

Say you have the Point class to be tested

class Point
{
    public int X {get;}
    public int Y {get;}
    public Point(x, y)
    {
        X = x;
        Y = x; //<- bug here
    }
}

and you want to test the constructor. Lets see how it will:

using NUnit.Framework;
using Knyaz.NUnit.AssertExpressions;

[TestFixture]
public class PointTests
{
    [Test]
    public static void ConstructorCreatesPoint() =>
        new Point(5, 6).Assert(point => point.X == 5 && point.Y == 6);
}

When you run the test you will see the message:

point.Y
  Expected: 6
  But was:  5

  • .NETFramework 4.5

    • NUnit (>= 3.0.0 && < 4.0.0)
  • .NETStandard 2.0

    • NUnit (>= 3.0.0 && < 4.0.0)

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated
1.0.0 296 5/17/2020