mirror of
https://github.com/bitwarden/server.git
synced 2025-07-04 09:32:48 -05:00
Enable testing of ASP.net MVC controllers
Controller properties have all kinds of validations in the background. In general, we don't user properties on our Controllers, so the easiest way to allow for Autofixture-based testing of our Controllers is to just omit setting all properties on them.
This commit is contained in:
22
test/Common/AutoFixture/Attributes/BitCustomizeAttribute.cs
Normal file
22
test/Common/AutoFixture/Attributes/BitCustomizeAttribute.cs
Normal file
@ -0,0 +1,22 @@
|
||||
using System;
|
||||
using AutoFixture;
|
||||
|
||||
namespace Bit.Test.Common.AutoFixture.Attributes
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>
|
||||
/// Base class for customizing parameters in methods decorated with the
|
||||
/// Bit.Test.Common.AutoFixture.Attributes.MemberAutoDataAttribute.
|
||||
/// </para>
|
||||
/// ⚠ Warning ⚠ Will not insert customizations into AutoFixture's AutoDataAttribute build chain
|
||||
/// </summary>
|
||||
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Method | AttributeTargets.Parameter, AllowMultiple = true)]
|
||||
public abstract class BitCustomizeAttribute : Attribute
|
||||
{
|
||||
/// <summary>
|
||||
/// /// Gets a customization for the method's parameters.
|
||||
/// </summary>
|
||||
/// <returns>A customization for the method's paramters.</returns>
|
||||
public abstract ICustomization GetCustomization();
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user