I’m happy to announce that NConstraints v1.1.1 has been released! This release updates the NuGet package from .NET Standard 1.6 to 2.0 and should work with all versions of NUnit 3.
You can install NConstraints via the dotnet command line:
dotnet add package SaturdayMP.NConstraints --version 1.1.1
Other install options can be found here.
NConstraints currently only has one constraint called EquivalentPropertyWiseTo. It checks if all the property values on two objects are the same. Instead of writting:
[Test]
public void TestObjectsTheSame()
{
var expected = new ExpectedClass() { ValueOne = 1, ValueTwo = "Blah", ValueThree = 33 };
var actual = MethodBeingTested();
Assert.That(expected.ValueOne, Is.EqualTo(actual.ValueOne));
Assert.That(expected.ValueTwo, Is.EqualTo(actual.ValueTwo));
Assert.That(expected.ValueThree, Is.EqualTo(actual.ValueThree));
}
You can write:
[Read More]