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.
44 lines
1.5 KiB
44 lines
1.5 KiB
using Microsoft.Extensions.DependencyInjection;
|
|
using Quartz;
|
|
using Xunit;
|
|
|
|
namespace OpenIddict.Quartz.Tests;
|
|
|
|
public class OpenIddictQuartzConfigurationTests
|
|
{
|
|
[Fact]
|
|
public void UseQuartz_RegistersJobDetails()
|
|
{
|
|
// Arrange
|
|
var options = new QuartzOptions();
|
|
var configuration = new OpenIddictQuartzConfiguration(new ServiceCollection().BuildServiceProvider());
|
|
|
|
// Act
|
|
configuration.Configure(options);
|
|
|
|
// Assert
|
|
Assert.Single(options.JobDetails);
|
|
Assert.Equal(OpenIddictQuartzJob.Identity, options.JobDetails[0].Key);
|
|
Assert.Equal(SR.GetResourceString(SR.ID8003), options.JobDetails[0].Key.Name);
|
|
Assert.Equal(SR.GetResourceString(SR.ID8005), options.JobDetails[0].Key.Group);
|
|
Assert.Equal(SR.GetResourceString(SR.ID8001), options.JobDetails[0].Description);
|
|
}
|
|
|
|
[Fact]
|
|
public void UseQuartz_RegistersTriggerDetails()
|
|
{
|
|
// Arrange
|
|
var options = new QuartzOptions();
|
|
var configuration = new OpenIddictQuartzConfiguration(new ServiceCollection().BuildServiceProvider());
|
|
|
|
// Act
|
|
configuration.Configure(options);
|
|
|
|
// Assert
|
|
Assert.Single(options.Triggers);
|
|
Assert.Equal(OpenIddictQuartzJob.Identity, options.Triggers[0].JobKey);
|
|
Assert.Equal(SR.GetResourceString(SR.ID8004), options.Triggers[0].Key.Name);
|
|
Assert.Equal(SR.GetResourceString(SR.ID8005), options.Triggers[0].Key.Group);
|
|
Assert.Equal(SR.GetResourceString(SR.ID8002), options.Triggers[0].Description);
|
|
}
|
|
}
|
|
|