mirror of
https://github.com/bitwarden/server.git
synced 2025-06-30 23:52:50 -05:00
Revert filescoped (#2227)
* Revert "Add git blame entry (#2226)" This reverts commit239286737d
. * Revert "Turn on file scoped namespaces (#2225)" This reverts commit34fb4cca2a
.
This commit is contained in:
@ -7,51 +7,52 @@ using Bit.Infrastructure.EntityFramework.Repositories;
|
||||
using Bit.Test.Common.AutoFixture;
|
||||
using Bit.Test.Common.AutoFixture.Attributes;
|
||||
|
||||
namespace Bit.Infrastructure.EFIntegration.Test.AutoFixture;
|
||||
|
||||
internal class OrganizationBuilder : ISpecimenBuilder
|
||||
namespace Bit.Infrastructure.EFIntegration.Test.AutoFixture
|
||||
{
|
||||
public object Create(object request, ISpecimenContext context)
|
||||
internal class OrganizationBuilder : ISpecimenBuilder
|
||||
{
|
||||
if (context == null)
|
||||
public object Create(object request, ISpecimenContext context)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(context));
|
||||
}
|
||||
if (context == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(context));
|
||||
}
|
||||
|
||||
var type = request as Type;
|
||||
if (type == null || type != typeof(Organization))
|
||||
var type = request as Type;
|
||||
if (type == null || type != typeof(Organization))
|
||||
{
|
||||
return new NoSpecimen();
|
||||
}
|
||||
|
||||
var fixture = new Fixture();
|
||||
var providers = fixture.Create<Dictionary<TwoFactorProviderType, TwoFactorProvider>>();
|
||||
var organization = new Fixture().WithAutoNSubstitutions().Create<Organization>();
|
||||
organization.SetTwoFactorProviders(providers);
|
||||
return organization;
|
||||
}
|
||||
}
|
||||
|
||||
internal class EfOrganization : ICustomization
|
||||
{
|
||||
public void Customize(IFixture fixture)
|
||||
{
|
||||
return new NoSpecimen();
|
||||
fixture.Customizations.Add(new IgnoreVirtualMembersCustomization());
|
||||
fixture.Customizations.Add(new GlobalSettingsBuilder());
|
||||
fixture.Customizations.Add(new OrganizationBuilder());
|
||||
fixture.Customizations.Add(new EfRepositoryListBuilder<OrganizationRepository>());
|
||||
}
|
||||
}
|
||||
|
||||
var fixture = new Fixture();
|
||||
var providers = fixture.Create<Dictionary<TwoFactorProviderType, TwoFactorProvider>>();
|
||||
var organization = new Fixture().WithAutoNSubstitutions().Create<Organization>();
|
||||
organization.SetTwoFactorProviders(providers);
|
||||
return organization;
|
||||
internal class EfOrganizationAutoDataAttribute : CustomAutoDataAttribute
|
||||
{
|
||||
public EfOrganizationAutoDataAttribute() : base(new SutProviderCustomization(), new EfOrganization())
|
||||
{ }
|
||||
}
|
||||
|
||||
internal class InlineEfOrganizationAutoDataAttribute : InlineCustomAutoDataAttribute
|
||||
{
|
||||
public InlineEfOrganizationAutoDataAttribute(params object[] values) : base(new[] { typeof(SutProviderCustomization),
|
||||
typeof(EfOrganization) }, values)
|
||||
{ }
|
||||
}
|
||||
}
|
||||
|
||||
internal class EfOrganization : ICustomization
|
||||
{
|
||||
public void Customize(IFixture fixture)
|
||||
{
|
||||
fixture.Customizations.Add(new IgnoreVirtualMembersCustomization());
|
||||
fixture.Customizations.Add(new GlobalSettingsBuilder());
|
||||
fixture.Customizations.Add(new OrganizationBuilder());
|
||||
fixture.Customizations.Add(new EfRepositoryListBuilder<OrganizationRepository>());
|
||||
}
|
||||
}
|
||||
|
||||
internal class EfOrganizationAutoDataAttribute : CustomAutoDataAttribute
|
||||
{
|
||||
public EfOrganizationAutoDataAttribute() : base(new SutProviderCustomization(), new EfOrganization())
|
||||
{ }
|
||||
}
|
||||
|
||||
internal class InlineEfOrganizationAutoDataAttribute : InlineCustomAutoDataAttribute
|
||||
{
|
||||
public InlineEfOrganizationAutoDataAttribute(params object[] values) : base(new[] { typeof(SutProviderCustomization),
|
||||
typeof(EfOrganization) }, values)
|
||||
{ }
|
||||
}
|
||||
|
Reference in New Issue
Block a user