using System;
using AutoFixture;
using Bit.Test.Common.AutoFixture.Attributes;
namespace Bit.Api.Test.AutoFixture.Attributes
{
///
/// Disables setting of Auto Properties on the Controller to avoid ASP.net initialization errors from a mock environment. Still sets constructor dependencies.
///
public class ControllerCustomizeAttribute : BitCustomizeAttribute
{
private readonly Type _controllerType;
///
/// Initialize an instance of the ControllerCustomizeAttribute class
///
/// The Type of the controller to allow autofixture to create
public ControllerCustomizeAttribute(Type controllerType)
{
_controllerType = controllerType;
}
public override ICustomization GetCustomization() => new ControllerCustomization(_controllerType);
}
}