mirror of
https://github.com/BinaryAlley/Nemera.git
synced 2026-12-03 09:11:10 +00:00
Completes the scheduler module coverage with a startup theme bootstrap and a stubbed cycle ticker
This commit is contained in:
1 parent
4b7cfbbe11
commit
315aed90f0
59 files changed
+5152
-65
No files matched your search
+29
@@ -67,6 +67,35 @@ public class ScheduledJobRepositoryTests
|
||||
Assert.Null(result.Value);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task GetByIdWithoutTrackingAsync_WhenScheduledJobExists_ShouldReturnScheduledJob()
|
||||
{
|
||||
// Arrange
|
||||
ScheduledJobEntity scheduledJob = _scheduledJobEntityFixture.Create();
|
||||
_mockContext.ScheduledJobs.Add(scheduledJob);
|
||||
await _mockContext.SaveChangesAsync();
|
||||
|
||||
// Act
|
||||
Result<ScheduledJobEntity?> result = await _sut.GetByIdWithoutTrackingAsync(scheduledJob.Id, CancellationToken.None);
|
||||
|
||||
// Assert
|
||||
Assert.False(result.IsFailure);
|
||||
Assert.NotNull(result.Value);
|
||||
Assert.Equal(scheduledJob.Id, result.Value!.Id);
|
||||
Assert.Equal(scheduledJob.Name, result.Value.Name);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task GetByIdWithoutTrackingAsync_WhenScheduledJobDoesNotExist_ShouldReturnNull()
|
||||
{
|
||||
// Act
|
||||
Result<ScheduledJobEntity?> result = await _sut.GetByIdWithoutTrackingAsync(Guid.NewGuid(), CancellationToken.None);
|
||||
|
||||
// Assert
|
||||
Assert.False(result.IsFailure);
|
||||
Assert.Null(result.Value);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task GetAllAsync_WhenScheduledJobsExist_ShouldReturnAllScheduledJobs()
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user