Skip to content

Fix EventService ListAsync for unit tests on net10: replace ToListAsync with ToList, fix mocks and CS8618 warnings#77

Merged
mahdiyebahmani merged 1 commit into
developfrom
feature/add-event-tests
Feb 20, 2026
Merged

Fix EventService ListAsync for unit tests on net10: replace ToListAsync with ToList, fix mocks and CS8618 warnings#77
mahdiyebahmani merged 1 commit into
developfrom
feature/add-event-tests

Conversation

@mahdiyebahmani

Copy link
Copy Markdown
Collaborator
  • Replaced ToListAsync with ToList + Task.FromResult in EventService.ListAsync
    to allow unit tests with in-memory IQueryable mocks without EF Core async provider.
  • Updated EventServiceTests to use NSubstitute and correctly mock repositories.
  • Fixed CS8618 warnings by initializing non-nullable fields in [SetUp] method.
  • Ensures all unit tests pass on .NET 10 without async EF dependencies.

…nc with ToList, fix mocks and CS8618 warnings
@mahdiyebahmani mahdiyebahmani merged commit 358d892 into develop Feb 20, 2026
2 checks passed
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.

1 participant