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 everything from Shouldly to FluentAssertions #1262

Merged
merged 5 commits into from
Nov 25, 2024

Conversation

myieye
Copy link
Contributor

@myieye myieye commented Nov 21, 2024

Migrates all our assertion from Shouldy to FluentAssertions as decided at our team meeting.

This should get User typeahead enabled for non-admin project managers unstuck.

Questionable:
- I created created custom assertions (e.g. ShouldNotBeNull()) as we discussed, but I put the class right in the Testing namespace
- I added a project reference from MiniLcm.Tests to Testing so it gets the custom assertions
- Adding that reference resulted in some package version differences that I resolved by updating them

EDIT: I just updated to a FluentAssertions 7 prerelease and they solved the problem for us.

Copy link

github-actions bot commented Nov 21, 2024

C# Unit Tests

90 tests   90 ✅  5s ⏱️
14 suites   0 💤
 1 files     0 ❌

Results for commit c5089dd.

♻️ This comment has been updated with latest results.

Copy link
Collaborator

@hahn-kev hahn-kev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good, though I don't like miniLcm tests referencing our lexbox tests

backend/Testing/CustomAssertions.cs Outdated Show resolved Hide resolved
backend/Testing/LexCore/LexAuthUserTests.cs Outdated Show resolved Hide resolved
backend/Testing/LexCore/Services/ProjectServiceTest.cs Outdated Show resolved Hide resolved
backend/Testing/CustomAssertions.cs Outdated Show resolved Hide resolved
@myieye myieye requested a review from hahn-kev November 22, 2024 13:37
@myieye
Copy link
Contributor Author

myieye commented Nov 22, 2024

6 dotnet failures. I'm going to try again.

And, it looks like my back-button fix doesn't work in Firefox 😢

@rmunn
Copy link
Contributor

rmunn commented Nov 25, 2024

@myieye - The 6 dotnet failures are all caused by the same one test:

srResult.ShouldContain("no changes from others");

The actual output is "No changes from others", with an uppercase N. ShouldContain in Shouldly was case-insensitive, but Should().Contain() is case-sensitive. We can either change that one to Should().ContainEquivalentOf() which is case-insensitive, or we can change the expected text to include a capital N. Given the large amount of text in the Send/Receive output (hundreds of lines), I'd suggest changing the expected text to be "No changes" with the capital N, because the case-sensitive comparison is likely to be faster to run.

@myieye myieye merged commit a525563 into develop Nov 25, 2024
12 of 13 checks passed
@myieye myieye deleted the chore/migrate-to-fluent-assertions branch November 25, 2024 09:49
@myieye
Copy link
Contributor Author

myieye commented Nov 25, 2024

@rmunn Thanks very much for fixing the .NET tests! There was just an unrelated Playwright failure, so this was good to merge 👍

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.

3 participants