1
0
mirror of https://github.com/bitwarden/server.git synced 2024-11-22 12:15:36 +01:00
bitwarden-server/test/Infrastructure.EFIntegration.Test/AutoFixture/UserFixtures.cs
2022-08-29 16:06:55 -04:00

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)
{ }
}