elsa-core/test/shared/Elsa.Testing.Shared/AutoFixture/Specifications/IsInstanceOf.cs
2021-09-16 20:26:18 +02:00

20 lines
565 B
C#

using System;
using AutoFixture.Kernel;
using Elsa.Testing.Shared.AutoFixture.SpecimenBuilders;
namespace Elsa.Testing.Shared.AutoFixture.Specifications
{
public class IsInstanceOf : IRequestSpecification
{
readonly Type _type;
public bool IsSatisfiedBy(object request) => request.IsAnAutofixtureRequestForType(_type);
public IsInstanceOf(Type type)
{
_type = type ?? throw new ArgumentNullException(nameof(type));
}
public static IsInstanceOf Type<T>() => new IsInstanceOf(typeof(T));
}
}