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

[Backend.Tests] Use Constraint Model in Helper, Models, and Services tests #2466

Merged
merged 8 commits into from
Aug 15, 2023

Conversation

Apoktieno
Copy link
Contributor

@Apoktieno Apoktieno commented Aug 11, 2023

Closes #2444


This change is Reviewable

@Apoktieno Apoktieno self-assigned this Aug 11, 2023
@Apoktieno Apoktieno force-pushed the BackendTestsConstraintModelAsserts branch from b7be876 to 2978aa6 Compare August 11, 2023 17:32
@codecov-commenter
Copy link

codecov-commenter commented Aug 11, 2023

Codecov Report

Patch coverage has no change and project coverage change: +0.10% 🎉

Comparison is base (a7e7fbf) 67.91% compared to head (165203c) 68.02%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2466      +/-   ##
==========================================
+ Coverage   67.91%   68.02%   +0.10%     
==========================================
  Files         240      240              
  Lines        8273     8273              
  Branches      504      504              
==========================================
+ Hits         5619     5628       +9     
+ Misses       2298     2289       -9     
  Partials      356      356              
Flag Coverage Δ
backend 79.76% <ø> (+0.20%) ⬆️
frontend 54.31% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

see 3 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Apoktieno Apoktieno marked this pull request as ready for review August 14, 2023 05:22
Copy link
Collaborator

@imnasnainaec imnasnainaec left a comment

Choose a reason for hiding this comment

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

Reviewed 14 of 17 files at r1, 2 of 4 files at r2, all commit messages.
Reviewable status: 16 of 18 files reviewed, 2 unresolved discussions (waiting on @Apoktieno)


Backend.Tests/Services/MergeServiceTests.cs line 196 at r2 (raw file):

            Assert.That(frontierWordIds, Does.Contain(childIds[0]));
            Assert.That(frontierWordIds, Does.Contain(childIds[1]));
            Assert.That(frontierWordIds, Does.Contain(childIds[2]));

Let's use a childIds.ForEach( loop here, so we don't have to explicitly [0], [1], and [2].


Backend.Tests/Services/StatisticsServiceTests.cs line 98 at r2 (raw file):

            var result = _statsService.GetSemanticDomainCounts(ProjId, "").Result;
            Assert.That(result, Has.Count.EqualTo(1));
            Assert.That(result.First(), Has.Count.EqualTo(0));

Could this one be Is.Empty?

Copy link
Collaborator

@imnasnainaec imnasnainaec left a comment

Choose a reason for hiding this comment

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

Reviewed 2 of 2 files at r3, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @Apoktieno)

@imnasnainaec imnasnainaec merged commit 1a183fe into master Aug 15, 2023
14 checks passed
@imnasnainaec imnasnainaec deleted the BackendTestsConstraintModelAsserts branch August 15, 2023 17:37
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.

[Backend.Tests] Use Constraint Model in all Asserts
3 participants