Skip to content

Conversation

@bodewig
Copy link
Member

@bodewig bodewig commented Aug 7, 2024

No description provided.

@bodewig bodewig mentioned this pull request Aug 7, 2024
@bodewig bodewig merged commit c9076f6 into main Aug 8, 2024
@bodewig bodewig deleted the make-constraints-work-with-nunit4 branch August 8, 2024 06:34
@ScottWrightWTG
Copy link

ScottWrightWTG commented Aug 9, 2024

No this still does not work. Unable to set the description anywhere when using the static constructors. The IsIdenticalTo calls ApplyTo which requires the Description which has not been set as it is protected.

Assert.That(resultNode, CompareConstraint.IsIdenticalTo(expectedNode));

Stack Trace:

CompareConstraint.ApplyTo[TActual](TActual actual)
Assert.That[TActual](TActual actual, IResolveConstraint expression, NUnitString message, String actualExpression, String constraintExpression)
MessageBuilderTest`2.CompleteMessage() line 30
RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)

Exception:

System.MissingMethodException : Method not found: 'Void NUnit.Framework.Constraints.Constraint.set_Description(System.String)'.

@bodewig
Copy link
Member Author

bodewig commented Aug 9, 2024

Thank you for reporting @ScottWrightWTG . This is what I get for merging some half-tested commit I made six months ago without recalling why I didn't merge it back then. My fault.

I've opened #42 and will try to write tests tat actually use NUnit 4.x to ensure things work.

Sorry about the delay.

@bodewig bodewig mentioned this pull request Mar 25, 2025
@bodewig
Copy link
Member Author

bodewig commented Mar 28, 2025

I have just published 2.11.0 with a new constraints assembly for NUnit 4.x

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants