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.
recyclarr/tests/Recyclarr.Cli.Tests/Processors/ConfigCreationProcessorTest.cs

35 lines
1011 B

using System.Diagnostics.CodeAnalysis;
using Autofac.Extras.Ordering;
using AutoFixture;
using Recyclarr.Cli.Console.Commands;
using Recyclarr.Cli.Processors;
using Recyclarr.Cli.Processors.Config;
namespace Recyclarr.Cli.Tests.Processors;
[TestFixture]
[Parallelizable(ParallelScope.All)]
public class ConfigCreationProcessorTest
{
[SuppressMessage("Performance", "CA1812", Justification =
"Used implicitly by test methods in this class")]
private sealed class EmptyOrderedEnumerable : ICustomization
{
public void Customize(IFixture fixture)
{
fixture.Inject(Array.Empty<IConfigCreator>().AsOrdered());
}
}
[Test, AutoMockData]
public void Throw_when_no_config_creators_can_handle(
[CustomizeWith(typeof(EmptyOrderedEnumerable))] ConfigCreationProcessor sut)
{
var settings = new ConfigCreateCommand.CliSettings();
var act = () => sut.Process(settings);
act.Should().Throw<FatalException>();
}
}