-
Notifications
You must be signed in to change notification settings - Fork 907
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
(#2893) Switch from Should to FluentAssertions #2908
(#2893) Switch from Should to FluentAssertions #2908
Conversation
It looks like FluentAssertions 6.x is not compatible with Visual Studio 2017. Since I have Visual Studio 2017 installed locally, the |
What happens if you change the |
@gep13 that fixed it. |
5130303
to
af4ba7b
Compare
af4ba7b
to
d0767a4
Compare
d0767a4
to
00054e7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have done a partial review to have something to get started on, and similar changes would be needed for the rest of the files.
src/chocolatey.tests.integration/infrastructure.app/services/FilesServiceSpecs.cs
Outdated
Show resolved
Hide resolved
src/chocolatey.tests.integration/infrastructure/filesystem/DotNetFileSystemSpecs.cs
Outdated
Show resolved
Hide resolved
src/chocolatey.tests.integration/infrastructure/filesystem/DotNetFileSystemSpecs.cs
Outdated
Show resolved
Hide resolved
src/chocolatey.tests.integration/infrastructure/filesystem/DotNetFileSystemSpecs.cs
Outdated
Show resolved
Hide resolved
src/chocolatey.tests.integration/infrastructure/filesystem/DotNetFileSystemSpecs.cs
Outdated
Show resolved
Hide resolved
60db09d
to
85be439
Compare
Task linked: PROJ-427 Switch Should to FluentAssertions |
1e0ebff
to
a37fb56
Compare
a37fb56
to
e961b2c
Compare
43fa9d8
to
dc382f7
Compare
1c1b580
to
3cf3150
Compare
This is ready for a re-review, I think I completed the suggested changes across the various test files. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some items I think should be fixed so that we have a reference when adding new tests.
Do note that there are quite a few other places that will benefit for similar changes that I haven't commented on, however only the ones I have commented on are required to be fixed at this moment.
src/chocolatey.tests.integration/infrastructure/filesystem/DotNetFileSystemSpecs.cs
Outdated
Show resolved
Hide resolved
src/chocolatey.tests.integration/infrastructure/filesystem/DotNetFileSystemSpecs.cs
Outdated
Show resolved
Hide resolved
src/chocolatey.tests.integration/infrastructure/filesystem/DotNetFileSystemSpecs.cs
Outdated
Show resolved
Hide resolved
src/chocolatey.tests/infrastructure.app/services/RulesServiceSpecs.cs
Outdated
Show resolved
Hide resolved
src/chocolatey.tests/infrastructure.app/services/RulesServiceSpecs.cs
Outdated
Show resolved
Hide resolved
src/chocolatey.tests/infrastructure/filesystem/DotNetFileSystemSpecs.cs
Outdated
Show resolved
Hide resolved
3cf3150
to
525fc47
Compare
0d18d5a
to
1a35a27
Compare
1a35a27
to
7b3f795
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, but had to downgrade the System.Runtime.CompilerServices.Unsafe
dependency as it causes problems with the build system, and we want to keep it closer to the version in other projects.
EDIT: Assuming this successfully builds now, we'll get this merged.
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.
As per the FluentAssertions api, various calls needed to be adjusted, mostly in the pattern Shouldxxxx() to Should().xxxx()
This is to allow Visual Studio 2017 to build the project. Otherwise, code in the FluentAssertions library will cause errors when build with VS2017.
This updates tests to use new ways of writing assertions that are available in FluentAssertions but where not in Should
7b3f795
to
c853166
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@TheCakeIsNaOH your changes have been merged. Thanks for your contribution 👍 |
* docs: add more example usages * Update README.md add @TheCakeIsNaOH chocolatey/choco#2908
Description Of Changes
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()
Motivation and Context
See #2893
Testing
Ran unit and integration tests with
build.ps1
and in Visual StudioChange Types Made
Related Issue
Change Checklist