mirror of
https://github.com/bitwarden/server.git
synced 2024-12-30 18:17:36 +01:00
32 lines
1.1 KiB
C#
32 lines
1.1 KiB
C#
using AutoFixture;
|
|
using Bit.Core.Test.AutoFixture.UserFixtures;
|
|
using Bit.Infrastructure.EntityFramework.Repositories;
|
|
using Bit.Test.Common.AutoFixture.Attributes;
|
|
|
|
namespace Bit.Infrastructure.EFIntegration.Test.AutoFixture;
|
|
|
|
internal class EfUser : UserFixture
|
|
{
|
|
public override void Customize(IFixture fixture)
|
|
{
|
|
fixture.Customizations.Add(new IgnoreVirtualMembersCustomization());
|
|
base.Customize(fixture);
|
|
fixture.Customizations.Add(new EfRepositoryListBuilder<UserRepository>());
|
|
fixture.Customizations.Add(new EfRepositoryListBuilder<SsoUserRepository>());
|
|
fixture.Customizations.Add(new EfRepositoryListBuilder<OrganizationRepository>());
|
|
}
|
|
}
|
|
|
|
internal class EfUserAutoDataAttribute : CustomAutoDataAttribute
|
|
{
|
|
public EfUserAutoDataAttribute() : base(new SutProviderCustomization(), new EfUser())
|
|
{ }
|
|
}
|
|
|
|
internal class InlineEfUserAutoDataAttribute : InlineCustomAutoDataAttribute
|
|
{
|
|
public InlineEfUserAutoDataAttribute(params object[] values) : base(new[] { typeof(SutProviderCustomization),
|
|
typeof(EfUser) }, values)
|
|
{ }
|
|
}
|