mirror of
https://github.com/bitwarden/server.git
synced 2025-06-30 23:52:50 -05:00
Turn on file scoped namespaces (#2225)
This commit is contained in:
@ -5,51 +5,50 @@ using Bit.Infrastructure.EntityFramework.Repositories;
|
||||
using Bit.Test.Common.AutoFixture;
|
||||
using Bit.Test.Common.AutoFixture.Attributes;
|
||||
|
||||
namespace Bit.Infrastructure.EFIntegration.Test.AutoFixture
|
||||
namespace Bit.Infrastructure.EFIntegration.Test.AutoFixture;
|
||||
|
||||
internal class GroupUserBuilder : ISpecimenBuilder
|
||||
{
|
||||
internal class GroupUserBuilder : ISpecimenBuilder
|
||||
public object Create(object request, ISpecimenContext context)
|
||||
{
|
||||
public object Create(object request, ISpecimenContext context)
|
||||
if (context == null)
|
||||
{
|
||||
if (context == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(context));
|
||||
}
|
||||
|
||||
var type = request as Type;
|
||||
if (type == null || type != typeof(GroupUser))
|
||||
{
|
||||
return new NoSpecimen();
|
||||
}
|
||||
|
||||
var fixture = new Fixture();
|
||||
var obj = fixture.WithAutoNSubstitutions().Create<GroupUser>();
|
||||
return obj;
|
||||
throw new ArgumentNullException(nameof(context));
|
||||
}
|
||||
}
|
||||
|
||||
internal class EfGroupUser : ICustomization
|
||||
{
|
||||
public void Customize(IFixture fixture)
|
||||
var type = request as Type;
|
||||
if (type == null || type != typeof(GroupUser))
|
||||
{
|
||||
fixture.Customizations.Add(new IgnoreVirtualMembersCustomization());
|
||||
fixture.Customizations.Add(new GlobalSettingsBuilder());
|
||||
fixture.Customizations.Add(new GroupUserBuilder());
|
||||
fixture.Customizations.Add(new EfRepositoryListBuilder<GroupRepository>());
|
||||
return new NoSpecimen();
|
||||
}
|
||||
}
|
||||
|
||||
internal class EfGroupUserAutoDataAttribute : CustomAutoDataAttribute
|
||||
{
|
||||
public EfGroupUserAutoDataAttribute() : base(new SutProviderCustomization(), new EfGroupUser())
|
||||
{ }
|
||||
}
|
||||
|
||||
internal class InlineEfGroupUserAutoDataAttribute : InlineCustomAutoDataAttribute
|
||||
{
|
||||
public InlineEfGroupUserAutoDataAttribute(params object[] values) : base(new[] { typeof(SutProviderCustomization),
|
||||
typeof(EfGroupUser) }, values)
|
||||
{ }
|
||||
var fixture = new Fixture();
|
||||
var obj = fixture.WithAutoNSubstitutions().Create<GroupUser>();
|
||||
return obj;
|
||||
}
|
||||
}
|
||||
|
||||
internal class EfGroupUser : ICustomization
|
||||
{
|
||||
public void Customize(IFixture fixture)
|
||||
{
|
||||
fixture.Customizations.Add(new IgnoreVirtualMembersCustomization());
|
||||
fixture.Customizations.Add(new GlobalSettingsBuilder());
|
||||
fixture.Customizations.Add(new GroupUserBuilder());
|
||||
fixture.Customizations.Add(new EfRepositoryListBuilder<GroupRepository>());
|
||||
}
|
||||
}
|
||||
|
||||
internal class EfGroupUserAutoDataAttribute : CustomAutoDataAttribute
|
||||
{
|
||||
public EfGroupUserAutoDataAttribute() : base(new SutProviderCustomization(), new EfGroupUser())
|
||||
{ }
|
||||
}
|
||||
|
||||
internal class InlineEfGroupUserAutoDataAttribute : InlineCustomAutoDataAttribute
|
||||
{
|
||||
public InlineEfGroupUserAutoDataAttribute(params object[] values) : base(new[] { typeof(SutProviderCustomization),
|
||||
typeof(EfGroupUser) }, values)
|
||||
{ }
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user