test: Fix analysis warnings for unused classes

pull/56/head
Robert Dailey 2 years ago
parent f570b098f1
commit e86b83c9ab

@ -1,4 +1,5 @@
using Autofac;
using System.Diagnostics.CodeAnalysis;
using Autofac;
using FluentAssertions;
using NUnit.Framework;
using Trash.Command;
@ -10,10 +11,14 @@ namespace Trash.Tests.Command.Helpers;
[Parallelizable(ParallelScope.All)]
public class CliTypeActivatorTest
{
// Warning CA1812 : an internal class that is apparently never instantiated.
[SuppressMessage("Performance", "CA1812", Justification = "Registered to and created by Autofac")]
private class NonServiceCommandType
{
}
// Warning CA1812 : an internal class that is apparently never instantiated.
[SuppressMessage("Performance", "CA1812", Justification = "Registered to and created by Autofac")]
private class StubCommand : IServiceCommand
{
public bool Preview => false;

@ -1,4 +1,5 @@
using System.Collections;
using System.Diagnostics.CodeAnalysis;
using Autofac;
using Autofac.Core;
using FluentAssertions;
@ -39,6 +40,11 @@ public class CompositionRootTest
act.Should().NotThrow();
}
// Warning CA1812 : CompositionRootTest.ConcreteTypeEnumerator is an internal class that is apparently never
// instantiated.
[SuppressMessage("Performance", "CA1812",
Justification = "Created via reflection by TestCaseSource attribute"
)]
private sealed class ConcreteTypeEnumerator : IEnumerable
{
private readonly IContainer _container;

Loading…
Cancel
Save