test/32/add_tests_for_TimelineItem_handler_and_fix_request_Id_handling#39
Open
InnetaSh wants to merge 4 commits into
Open
test/32/add_tests_for_TimelineItem_handler_and_fix_request_Id_handling#39InnetaSh wants to merge 4 commits into
InnetaSh wants to merge 4 commits into
Conversation
|
❌ The last analysis has failed. |
snitochka
approved these changes
May 10, 2026
| It.IsAny<Func<IQueryable<TimelineItem>, IIncludableQueryable<TimelineItem, object>>>())) | ||
| .ReturnsAsync(timelineItems); | ||
|
|
||
| this.mapperMock |
Contributor
There was a problem hiding this comment.
This setup forces mapper to return "expectedDtos" regardless of input, meaning our test will always pass. Consider not to use mocked mapper, but mapper itself to fix this problem. Fix other tests, having the same problem.
|
|
||
| var expectedDtos = new List<TimelineItemDTO> | ||
| { | ||
| new TimelineItemDTO |
Contributor
There was a problem hiding this comment.
When you will use mapper itself, you can use Map() method here to ensure "expectedDtos" and an actual output of the handler to be the same
|
|
||
| var result = await this.handler.Handle(query, CancellationToken.None); | ||
|
|
||
| Assert.True(result.IsSuccess); |
Contributor
There was a problem hiding this comment.
Suggest using fluent assertions and method BeEquivalentTo() to compare "result.Value" and "expectedDtos"
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
dev
JIRA
Code reviewers
Second Level Review
Summary of issue
Fix
Handler now correctly uses request.Id (previously ignored).
Test
Added missing unit tests for MediatR/Timeline/TimelineItem.
Related tasks:
bug/issues/3
test/issues/32
Summary of change
Fixed handler logic to correctly use request.Id
Added unit tests for TimelineItem MediatR handler
Testing approach
Added unit tests for TimelineItem handler
Covered cases:
valid Id processing
invalid / non-existing Id handling
edge cases (null/invalid input if applicable)
Verified tests locally
CHECK LIST