You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
abp/framework/test/Volo.Abp.BackgroundJobs.Tests/Volo/Abp/BackgroundJobs/BackgroundJobManager_Tests.cs

36 lines
1.2 KiB

using System;
using System.Threading.Tasks;
using Shouldly;
using Xunit;
namespace Volo.Abp.BackgroundJobs
{
public class BackgroundJobManager_Tests : BackgroundJobsTestBase
{
private readonly IBackgroundJobManager _backgroundJobManager;
private readonly IBackgroundJobStore _backgroundJobStore;
public BackgroundJobManager_Tests()
{
_backgroundJobManager = GetRequiredService<IBackgroundJobManager>();
_backgroundJobStore = GetRequiredService<IBackgroundJobStore>();
}
[Fact]
public async Task Should_Store_Jobs()
{
var jobIdAsString = await _backgroundJobManager.EnqueueAsync(new MyJobArgs("42"));
jobIdAsString.ShouldNotBe(default);
(await _backgroundJobStore.FindAsync(Guid.Parse(jobIdAsString))).ShouldNotBeNull();
}
[Fact]
public async Task Should_Store_Async_Jobs()
{
var jobIdAsString = await _backgroundJobManager.EnqueueAsync(new MyAsyncJobArgs("42"));
jobIdAsString.ShouldNotBe(default);
(await _backgroundJobStore.FindAsync(Guid.Parse(jobIdAsString))).ShouldNotBeNull();
}
}
}