Skip to content

Rewrite tests to use messages from resource file - #98

Open
TakerTrip wants to merge 1 commit into
devfrom
chore/80/rewrite-tests
Open

Rewrite tests to use messages from resource file#98
TakerTrip wants to merge 1 commit into
devfrom
chore/80/rewrite-tests

Conversation

@TakerTrip

Copy link
Copy Markdown
Contributor

dev

JIRA

Code reviewers

Second Level Review

Summary of issue

Refactored unit tests to use messages from the .resx resource file instead of hardcoded string values.

Summary of change

  • Added TestMessages.resx containing expected error and exception messages.
  • Added the strongly typed generated TestMessages.Designer.cs class.
  • Configured resource generation in Streetcode.XUnitTest.csproj.
  • Replaced hardcoded messages in unit-test assertions.
  • Replaced hardcoded messages in logger verifications.
  • Added formatting of parameterized resource messages using string.Format.
  • Kept ordinary test data, such as URLs, titles, and DTO values, outside the resource file.

Testing approach

  • Ran the complete solution test suite.
  • All 153 unit tests pass.
  • No failed or skipped unit tests.

Test results

Passed: 153, Failed: 0, Skipped: 0

Closes #80

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

@sonarqubecloud

Copy link
Copy Markdown

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.

Rewrite tests to use the messages from the .resx file

1 participant