Skip to content

Test/6/streetcode text#51

Open
NikitaPankin wants to merge 15 commits into
devfrom
test/6/streetcode-text
Open

Test/6/streetcode text#51
NikitaPankin wants to merge 15 commits into
devfrom
test/6/streetcode-text

Conversation

@NikitaPankin
Copy link
Copy Markdown

@NikitaPankin NikitaPankin commented May 12, 2026

dev

JIRA

Code reviewers

  • @github_username

Second Level Review

  • @github_username

Summary of issue

Write unit tests for StreetCode/Text

Summary of change

Add tests for GetAllTextsHandler, GetTextByIdHandler, GetTextByStreetcodeIdHandler, GetParsedTextAdminPreviewHandler and AddTermsToTextService

Testing approach

ToDo

CHECK LIST

  • СI passed
  • Сode coverage >=95%
  • PR is reviewed manually again (to make sure you have 100% ready code)
  • All reviewers agreed to merge the PR
  • I've checked new feature as logged in and logged out user if needed
  • PR meets all conventions

@NikitaPankin NikitaPankin added test Write test and removed test Write test labels May 12, 2026
@NikitaPankin NikitaPankin linked an issue May 12, 2026 that may be closed by this pull request
@sonarqubecloud
Copy link
Copy Markdown

❌ The last analysis has failed.

See analysis details on SonarQube Cloud

It.IsAny<Func<IQueryable<TextEntity>, IIncludableQueryable<TextEntity, object>>?>()))
.ReturnsAsync(texts);

this.mapperMock
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Setup mapper like this, forces handler to always return "textDtos", regardless of the result of GetAllAsync() method. This causes test to always pass. Replace mapper mock with mapper itself to fix this problem. Check other tests for the same problem.

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.

Write unit tests for StreetCode/Text

2 participants