mirror of
https://github.com/bitwarden/server.git
synced 2024-12-01 13:43:23 +01:00
bae03feffe
* Revert "Add git blame entry (#2226)" This reverts commit239286737d
. * Revert "Turn on file scoped namespaces (#2225)" This reverts commit34fb4cca2a
.
46 lines
1.3 KiB
C#
46 lines
1.3 KiB
C#
using System.Reflection;
|
|
using AutoFixture;
|
|
using AutoFixture.Xunit2;
|
|
using Bit.Core.Enums.Provider;
|
|
|
|
namespace Bit.Commercial.Core.Test.AutoFixture
|
|
{
|
|
internal class ProviderUser : ICustomization
|
|
{
|
|
public ProviderUserStatusType Status { get; set; }
|
|
public ProviderUserType Type { get; set; }
|
|
|
|
public ProviderUser(ProviderUserStatusType status, ProviderUserType type)
|
|
{
|
|
Status = status;
|
|
Type = type;
|
|
}
|
|
|
|
public void Customize(IFixture fixture)
|
|
{
|
|
fixture.Customize<Bit.Core.Entities.Provider.ProviderUser>(composer => composer
|
|
.With(o => o.Type, Type)
|
|
.With(o => o.Status, Status));
|
|
}
|
|
}
|
|
|
|
public class ProviderUserAttribute : CustomizeAttribute
|
|
{
|
|
private readonly ProviderUserStatusType _status;
|
|
private readonly ProviderUserType _type;
|
|
|
|
public ProviderUserAttribute(
|
|
ProviderUserStatusType status = ProviderUserStatusType.Confirmed,
|
|
ProviderUserType type = ProviderUserType.ProviderAdmin)
|
|
{
|
|
_status = status;
|
|
_type = type;
|
|
}
|
|
|
|
public override ICustomization GetCustomization(ParameterInfo parameter)
|
|
{
|
|
return new ProviderUser(_status, _type);
|
|
}
|
|
}
|
|
}
|