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

Migrate from Should to FluentAssertions #2893

Closed
TheCakeIsNaOH opened this issue Nov 9, 2022 · 4 comments · Fixed by #2908
Closed

Migrate from Should to FluentAssertions #2893

TheCakeIsNaOH opened this issue Nov 9, 2022 · 4 comments · Fixed by #2908
Assignees
Labels
5 - Released NO RELEASE NOTES Should not be included in the release notes - not enhancing or fixing end product. Task Tests Issues related to the tests (NUnit or Pester)
Milestone

Comments

@TheCakeIsNaOH
Copy link
Member

Is Your Feature Request Related To A Problem? Please describe.

Currently, the integration tests library uses the Should nuget package for assertions in tests.
This package is only build for .Net framework, and not newer Dotnet versions.
It appears to be abandoned, with the last release to nuget.org pushed what is getting close to a decade ago, and old un-merged pulled requests on the source repository:
erichexter/Should#19

It does not have a complete complement of assertions, there are other libraries with more.

Describe The Solution. Why is it needed?

So it would be good to switch to another library that is built for .Net Standard, so it can be used with .Net 4.8 and the forthcoming dotnet build.

There are two popular options for assertion libraries that I am aware of:
https://www.nuget.org/packages/FluentAssertions
And
https://www.nuget.org/packages/Shouldly

As far as I am aware, they should be both good options, and it is up to whatever team members like better, or which is already in use elsewhere.

Additional Context.

N/A

Related Issues

@TheCakeIsNaOH TheCakeIsNaOH added 0 - _Triaging Task Tests Issues related to the tests (NUnit or Pester) labels Nov 9, 2022
@gep13
Copy link
Member

gep13 commented Nov 11, 2022

I had a quick chat with @AdmiringWorm about this today, and we are thinking that FluentAssertions might be the way to go.

@TheCakeIsNaOH thoughts?

@TheCakeIsNaOH
Copy link
Member Author

@gep13 sounds good to me.

One additional thing I forgot to mention was that TinySpec.NUnit takes a dependency on Should, but the TinySpec package is planned to be removed as a part of #2880, so it should not be an issue for much longer.

@tapika

This comment was marked as off-topic.

@gep13 gep13 changed the title Migrate from Should to another assertions library. Migrate from Should to FluentAssertions Nov 15, 2022
TheCakeIsNaOH added a commit to TheCakeIsNaOH/choco that referenced this issue Nov 18, 2022
This switches chocolatey.tests and chocolatey.tests.integration
to use FluentAssertions instead of Should. This is because Should
is no longer actively maintained, so it is time to replace it.

As per the FluentAssertions api, various calls needed to be adjusted,
mostly in the pattern Shouldxxxx() to Should().xxxx()
TheCakeIsNaOH added a commit to TheCakeIsNaOH/choco that referenced this issue Nov 18, 2022
This is to allow Visual Studio 2017 to build the project.
Otherwise, code in the FluentAssertions library will cause errors when build with VS2017.
TheCakeIsNaOH added a commit to TheCakeIsNaOH/choco that referenced this issue Nov 22, 2022
This switches chocolatey.tests and chocolatey.tests.integration
to use FluentAssertions instead of Should. This is because Should
is no longer actively maintained, so it is time to replace it.

As per the FluentAssertions api, various calls needed to be adjusted,
mostly in the pattern Shouldxxxx() to Should().xxxx()
TheCakeIsNaOH added a commit to TheCakeIsNaOH/choco that referenced this issue Nov 22, 2022
This is to allow Visual Studio 2017 to build the project.
Otherwise, code in the FluentAssertions library will cause errors when build with VS2017.
TheCakeIsNaOH added a commit to TheCakeIsNaOH/choco that referenced this issue Nov 23, 2022
This switches chocolatey.tests and chocolatey.tests.integration
to use FluentAssertions instead of Should. This is because Should
is no longer actively maintained, so it is time to replace it.

As per the FluentAssertions api, various calls needed to be adjusted,
mostly in the pattern Shouldxxxx() to Should().xxxx()
TheCakeIsNaOH added a commit to TheCakeIsNaOH/choco that referenced this issue Nov 23, 2022
This is to allow Visual Studio 2017 to build the project.
Otherwise, code in the FluentAssertions library will cause errors when build with VS2017.
TheCakeIsNaOH added a commit to TheCakeIsNaOH/choco that referenced this issue Nov 23, 2022
This switches chocolatey.tests and chocolatey.tests.integration
to use FluentAssertions instead of Should. This is because Should
is no longer actively maintained, so it is time to replace it.

As per the FluentAssertions api, various calls needed to be adjusted,
mostly in the pattern Shouldxxxx() to Should().xxxx()
TheCakeIsNaOH added a commit to TheCakeIsNaOH/choco that referenced this issue Nov 23, 2022
This is to allow Visual Studio 2017 to build the project.
Otherwise, code in the FluentAssertions library will cause errors when build with VS2017.
TheCakeIsNaOH added a commit to TheCakeIsNaOH/choco that referenced this issue Nov 23, 2022
This switches chocolatey.tests and chocolatey.tests.integration
to use FluentAssertions instead of Should. This is because Should
is no longer actively maintained, so it is time to replace it.

Only the package and dependencies are switched. The code changes
be in the next commit.
TheCakeIsNaOH added a commit to TheCakeIsNaOH/choco that referenced this issue Nov 23, 2022
As per the FluentAssertions api, various calls needed to be adjusted,
mostly in the pattern Shouldxxxx() to Should().xxxx()
TheCakeIsNaOH added a commit to TheCakeIsNaOH/choco that referenced this issue Nov 23, 2022
This is to allow Visual Studio 2017 to build the project.
Otherwise, code in the FluentAssertions library will cause errors when build with VS2017.
TheCakeIsNaOH added a commit to TheCakeIsNaOH/choco that referenced this issue Nov 23, 2022
This switches chocolatey.tests and chocolatey.tests.integration
to use FluentAssertions instead of Should. This is because Should
is no longer actively maintained, so it is time to replace it.

Only the package and dependencies are switched. The code changes
be in the next commit.
TheCakeIsNaOH added a commit to TheCakeIsNaOH/choco that referenced this issue Nov 23, 2022
As per the FluentAssertions api, various calls needed to be adjusted,
mostly in the pattern Shouldxxxx() to Should().xxxx()
TheCakeIsNaOH added a commit to TheCakeIsNaOH/choco that referenced this issue Dec 13, 2022
This switches chocolatey.tests and chocolatey.tests.integration
to use FluentAssertions instead of Should. This is because Should
is no longer actively maintained, so it is time to replace it.

Only the package and dependencies are switched. The code changes
be in the next commit.
TheCakeIsNaOH added a commit to TheCakeIsNaOH/choco that referenced this issue Dec 13, 2022
As per the FluentAssertions api, various calls needed to be adjusted,
mostly in the pattern Shouldxxxx() to Should().xxxx()
TheCakeIsNaOH added a commit to TheCakeIsNaOH/choco that referenced this issue Dec 13, 2022
This is to allow Visual Studio 2017 to build the project.
Otherwise, code in the FluentAssertions library will cause errors when build with VS2017.
TheCakeIsNaOH added a commit to TheCakeIsNaOH/choco that referenced this issue Jun 4, 2023
This updates tests to use new ways of writing assertions that are available in
FluentAssertions but where not in Should
TheCakeIsNaOH added a commit to TheCakeIsNaOH/choco that referenced this issue Jun 4, 2023
This switches chocolatey.tests and chocolatey.tests.integration
to use FluentAssertions instead of Should. This is because Should
is no longer actively maintained, so it is time to replace it.

The Fluent Assertions Analyzers are also added in this commit.

Only the package and dependencies are switched. The code
changes be in the next commit.
TheCakeIsNaOH added a commit to TheCakeIsNaOH/choco that referenced this issue Jun 4, 2023
As per the FluentAssertions api, various calls needed to be adjusted,
mostly in the pattern Shouldxxxx() to Should().xxxx()
TheCakeIsNaOH added a commit to TheCakeIsNaOH/choco that referenced this issue Jun 4, 2023
This is to allow Visual Studio 2017 to build the project.
Otherwise, code in the FluentAssertions library will cause errors when build with VS2017.
TheCakeIsNaOH added a commit to TheCakeIsNaOH/choco that referenced this issue Jun 4, 2023
This updates tests to use new ways of writing assertions that are available in
FluentAssertions but where not in Should
TheCakeIsNaOH added a commit to TheCakeIsNaOH/choco that referenced this issue Jun 4, 2023
This updates tests to use new ways of writing assertions that are available in
FluentAssertions but where not in Should
TheCakeIsNaOH added a commit to TheCakeIsNaOH/choco that referenced this issue Jun 4, 2023
This updates tests to use new ways of writing assertions that are available in
FluentAssertions but where not in Should
TheCakeIsNaOH added a commit to TheCakeIsNaOH/choco that referenced this issue Jun 6, 2023
This switches chocolatey.tests and chocolatey.tests.integration
to use FluentAssertions instead of Should. This is because Should
is no longer actively maintained, so it is time to replace it.

The Fluent Assertions Analyzers are also added in this commit.

Only the package and dependencies are switched. The code
changes be in the next commit.
TheCakeIsNaOH added a commit to TheCakeIsNaOH/choco that referenced this issue Jun 6, 2023
As per the FluentAssertions api, various calls needed to be adjusted,
mostly in the pattern Shouldxxxx() to Should().xxxx()
TheCakeIsNaOH added a commit to TheCakeIsNaOH/choco that referenced this issue Jun 6, 2023
This is to allow Visual Studio 2017 to build the project.
Otherwise, code in the FluentAssertions library will cause errors when build with VS2017.
TheCakeIsNaOH added a commit to TheCakeIsNaOH/choco that referenced this issue Jun 6, 2023
This updates tests to use new ways of writing assertions that are available in
FluentAssertions but where not in Should
TheCakeIsNaOH added a commit to TheCakeIsNaOH/choco that referenced this issue Jun 6, 2023
This updates tests to use new ways of writing assertions that are available in
FluentAssertions but where not in Should
TheCakeIsNaOH added a commit to TheCakeIsNaOH/choco that referenced this issue Jun 6, 2023
This updates tests to use new ways of writing assertions that are available in
FluentAssertions but where not in Should
AdmiringWorm pushed a commit to TheCakeIsNaOH/choco that referenced this issue Jun 6, 2023
This switches chocolatey.tests and chocolatey.tests.integration
to use FluentAssertions instead of Should. This is because Should
is no longer actively maintained, so it is time to replace it.

The Fluent Assertions Analyzers are also added in this commit.

Only the package and dependencies are switched. The code
changes be in the next commit.
AdmiringWorm pushed a commit to TheCakeIsNaOH/choco that referenced this issue Jun 6, 2023
As per the FluentAssertions api, various calls needed to be adjusted,
mostly in the pattern Shouldxxxx() to Should().xxxx()
AdmiringWorm pushed a commit to TheCakeIsNaOH/choco that referenced this issue Jun 6, 2023
This is to allow Visual Studio 2017 to build the project.
Otherwise, code in the FluentAssertions library will cause errors when build with VS2017.
AdmiringWorm pushed a commit to TheCakeIsNaOH/choco that referenced this issue Jun 6, 2023
This updates tests to use new ways of writing assertions that are available in
FluentAssertions but where not in Should
AdmiringWorm pushed a commit to TheCakeIsNaOH/choco that referenced this issue Jun 6, 2023
This switches chocolatey.tests and chocolatey.tests.integration
to use FluentAssertions instead of Should. This is because Should
is no longer actively maintained, so it is time to replace it.

The Fluent Assertions Analyzers are also added in this commit.

Only the package and dependencies are switched. The code
changes be in the next commit.
AdmiringWorm pushed a commit to TheCakeIsNaOH/choco that referenced this issue Jun 6, 2023
As per the FluentAssertions api, various calls needed to be adjusted,
mostly in the pattern Shouldxxxx() to Should().xxxx()
AdmiringWorm pushed a commit to TheCakeIsNaOH/choco that referenced this issue Jun 6, 2023
This is to allow Visual Studio 2017 to build the project.
Otherwise, code in the FluentAssertions library will cause errors when build with VS2017.
AdmiringWorm pushed a commit to TheCakeIsNaOH/choco that referenced this issue Jun 6, 2023
This updates tests to use new ways of writing assertions that are available in
FluentAssertions but where not in Should
@AdmiringWorm AdmiringWorm added 4 - Done NO RELEASE NOTES Should not be included in the release notes - not enhancing or fixing end product. and removed 2 - Working labels Jun 6, 2023
@AdmiringWorm AdmiringWorm added this to the 2.1.0 milestone Jun 6, 2023
AdmiringWorm added a commit that referenced this issue Jun 6, 2023
@choco-bot
Copy link

🎉 This issue has been resolved in version 2.1.0 🎉

The release is available on:

Your GitReleaseManager bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
5 - Released NO RELEASE NOTES Should not be included in the release notes - not enhancing or fixing end product. Task Tests Issues related to the tests (NUnit or Pester)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants