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

Method not found error on NUnit 4 #256

Closed
lucasteles opened this issue Nov 27, 2023 · 6 comments
Closed

Method not found error on NUnit 4 #256

lucasteles opened this issue Nov 27, 2023 · 6 comments
Assignees

Comments

@lucasteles
Copy link

Description

This project sets the NUnit dependency as NUnit ≥ 3.14.0 but, when running an assertion on a project with NUnit 4.0.0 I am getting a reflection error:

System.MissingMethodException : Method not found: 'Void NUnit.Framework.Assert.That(System.__Canon, NUnit.Framework.Constraints.IResolveConstraint)'.
   at FsUnit.TopLevelOperators.should[a,a](FSharpFunc`2 f, a x, Object actual)
   at Astrorex.Api.Tests.EscolaControllerTests.Deve adicionar role "aluno" no usuario() in C:\d\Astrorex.Api\tests\Astrorex.Api.Tests.Integracao\EscolaControllerTests.fs:line 294
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
   at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)

Repro steps

  1. Install NUnit 4 and FSUnit
  2. Run an assertion

Expected behavior

Should work without errors

Actual behavior

Given reflection error

Known workarounds

Downgrade NUnit

@CaptnCodr
Copy link
Member

Hi @lucasteles, it seems that FsUnit isn't compatible with NUnit 4.0 at the time being. I will migrate FsUnit in the next few days to the latest version of NUnit.
Please use NUnit 3.14.0 as you already described in the workarounds.

Thank you for the patience.

@CaptnCodr CaptnCodr self-assigned this Nov 27, 2023
@CaptnCodr
Copy link
Member

CaptnCodr commented Nov 28, 2023

An upgrade to NUnit 4.0 is due to an issue with the compatibility not possible.
I filed an issue for that: nunit/nunit#4568

I keep you updated.

@CaptnCodr
Copy link
Member

CaptnCodr commented Nov 29, 2023

I will release a fix for this issue, that you don't even upgrade NUnit to the next major version when FsUnit is installed.

Next, I probably will migrate to NUnit 4.0 and create a new major version. But NUnit 4.0 isn't that important for now.
I'll put that on the list.

@CaptnCodr
Copy link
Member

CaptnCodr commented Nov 29, 2023

@lucasteles

I will release a fix for this issue, that you don't even upgrade NUnit to the next major version when FsUnit is installed.
FsUnit 5.6.1 is ready to use. There should be a warning when NUnit 4.0.0 is installed with the newest release.

I will make a plan for the NUnit 4.0.0 migration. NUnit 3.X will be supported for the time being.

Have fun! 🙂

@CaptnCodr CaptnCodr mentioned this issue Dec 6, 2023
4 tasks
@CaptnCodr
Copy link
Member

Hey @lucasteles,
FsUnit 6.0.0-alpha1 is now available.
You could test this version out if everything works as expected. Leave a message if you had.

@CaptnCodr
Copy link
Member

FsUnit v6.0 is now available!

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

No branches or pull requests

2 participants