First of all TUnit is AWESOME!
so I am converting some of my tests to TUnit. (for learning purposes) :)
I am getting an error with the code below.
The fluentassertions version works but the TUnit assertion doesn't.
Am I doing the assertion wrong or is it a bug?
Is there another way I can do this?
var result1 = new ComplexObject(Key: "key", Value: "value");
var result2 = new { Key = "key", Value = "value" };
result1.Should().BeEquivalentTo(result2); // FluentAssertions works
await Assert.That(result1).IsEquivalentTo(result2); // TUnit doesn't work.
// TUnit gives this compile time error: The type arguments for method 'EquivalentToAssertionBuilderWrapper<TActual> TUnit.Assertions.Extensions.GenericIsExtensions.IsEquivalentTo<TActual>(this IValueSource<TActual>, TActual, string)' cannot be inferred from the usage. Try specifying the type arguments explicitly.
It's because the types don't match. I suppose it's a bug because we might want to compare two similar objects that are technically different types. I'll keep this open.
First of all TUnit is AWESOME! so I am converting some of my tests to TUnit. (for learning purposes) :) I am getting an error with the code below. The fluentassertions version works but the TUnit assertion doesn't. Am I doing the assertion wrong or is it a bug? Is there another way I can do this?