Skip to content
New issue

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

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

Already on GitHub? # to your account

Non-throwing methods returning null don't pass DoesNotThrow() #343

Closed
1 of 5 tasks
bacar opened this issue Dec 13, 2023 · 7 comments
Closed
1 of 5 tasks

Non-throwing methods returning null don't pass DoesNotThrow() #343

bacar opened this issue Dec 13, 2023 · 7 comments
Assignees
Labels
bug fixed in codebase Fix is integrated in the code base, to be released

Comments

@bacar
Copy link

bacar commented Dec 13, 2023

Bug Type
Please pick one:

  • a check failed to detect an error (false negative), i.e. a test is green while it should be red.
  • a check raised a non existing error (false positive), i.e a test is red while it should be green.
  • an error message is invalid/incomplete (please provide samples)
  • a ran into an exception.
  • other.

Describe the bug

The following test should pass, but does not:

    [Test]
    public void NonThrowingMethodsReturningNull()
    {
        object ReturnNull() => null;
        ReturnNull(); // does not throw
        Check.ThatCode(() => ReturnNull()).DoesNotThrow();
    }

The exception originates in NFluent.Extensions.ObjectExtensions.IsAwaitable[T] -- it does not deal with nulls.

Desktop (please complete the following information):

  • NFluent version: 3.0.2.500
  • Net Version: Fwmk 4.8
@bacar bacar added the bug label Dec 13, 2023
@dupdob
Copy link
Collaborator

dupdob commented Dec 13, 2023

I just published a beta version with a fix of this (and 342 as well)

@dupdob dupdob added the fixed in codebase Fix is integrated in the code base, to be released label Dec 13, 2023
@bacar
Copy link
Author

bacar commented Dec 13, 2023

Awesome - just tried, fixes my issues.

@dupdob
Copy link
Collaborator

dupdob commented Dec 13, 2023

as you seem to be exploring, I propose to wait for a couple of weeks before releasing the fix; this will give you time to raise other issues you may find and have a single release, vs several ones for each issue found :-)

@bacar
Copy link
Author

bacar commented Dec 19, 2023

I've finished running the upgrade against our codebase FWIW, no further issues found.

@bacar
Copy link
Author

bacar commented Jan 10, 2024

Bonne année ! Any chance of a non-beta release? Thank you so much!

@dupdob
Copy link
Collaborator

dupdob commented Jan 12, 2024

Happy new year as well.
I published V 3.0.3 final this morning.
Note: since the new solution architecture (using multitargeting) is not CI level ready yet, I have to build and publish them manually, something I am reluctant to do, but on the other hand I do not have enough bandwidth to complete the migration 😄.

@bacarrcm
Copy link

Excellent, thank you! Finally merged our upgrade from 2.7.2!

@dupdob dupdob closed this as completed Jan 16, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug fixed in codebase Fix is integrated in the code base, to be released
Projects
None yet
Development

No branches or pull requests

3 participants