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

Feature/JA-111 BrowseControllerTests #101

Merged
merged 15 commits into from
May 28, 2024

Conversation

Zjyslav
Copy link
Collaborator

@Zjyslav Zjyslav commented May 18, 2024

I created tests for BrowseController.
I'm testing:

  • if requests are created with the value we expect
  • what are return types of actions in certain situations (are they ViewResult or RedirectToActionResult?)

There is some repetition in tests, but I wanted some cases to clearly stand out from others (valid values vs invalid).

I also changed names of some DTOs to be consistent with names of the methods they are used in.

Zjyslav added 12 commits May 18, 2024 20:20
Remove old TODO comment, remove unused usings.
Test: Ads_WhenProvidedInvalidPageNumber_ShouldAskForPageOne
Test: Ads_WhenProvidedValidPageNumber_ShouldAskForCorrectPage
Tests:
- Ads_WhenResponseIsUnsuccessful_ShouldReturnRedirectToAction
- Ads_WhenResponseIsSuccessful_ShouldReturnView
Test - AdDetails_WhenUserIdIsNull_ShouldReturnRedirectToAction
Test - AdDetails_WhenUserIsNotNull_ShouldSendCorrectRequest
Tests:
- AdDetails_WhenResponseIsNull_ShouldReturnRedirectToAction
- AdDetails_WhenResponseIsNull_ShouldReturnView
Tests:
- Schedule_WhenUserIdIsNull_ShouldReturnRedirectToAction
- Schedule_WhenUserIdIsNotNull_ShouldReturnRedirectView
- Schedule_WhenUserIdIsNotNull_ShouldSendCorrectRequest
Copy link
Collaborator

@skrawus skrawus left a comment

Choose a reason for hiding this comment

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

It works and the logic seems to be ok

@skrawus skrawus merged commit 5267f1c into develop May 28, 2024
1 check passed
@Zjyslav Zjyslav deleted the feature/ja-111-browse-controller-tests branch May 29, 2024 23:09
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.

None yet

2 participants