Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

override Description in constraints, might be enough to support NUnit4 #41

Merged
merged 1 commit into from
Aug 8, 2024

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
0 of 2 checks passed
@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.

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.

2 participants