mirror of
https://github.com/bitwarden/server.git
synced 2025-06-30 07:36:14 -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:
@ -3,35 +3,36 @@ using AutoFixture.Kernel;
|
||||
using Bit.Core.Context;
|
||||
using Bit.Test.Common.AutoFixture;
|
||||
|
||||
namespace Bit.Core.Test.AutoFixture.CurrentContextFixtures;
|
||||
|
||||
internal class CurrentContext : ICustomization
|
||||
namespace Bit.Core.Test.AutoFixture.CurrentContextFixtures
|
||||
{
|
||||
public void Customize(IFixture fixture)
|
||||
internal class CurrentContext : ICustomization
|
||||
{
|
||||
fixture.Customizations.Add(new CurrentContextBuilder());
|
||||
}
|
||||
}
|
||||
|
||||
internal class CurrentContextBuilder : ISpecimenBuilder
|
||||
{
|
||||
public object Create(object request, ISpecimenContext context)
|
||||
{
|
||||
if (context == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(context));
|
||||
}
|
||||
if (!(request is Type typeRequest))
|
||||
{
|
||||
return new NoSpecimen();
|
||||
}
|
||||
if (typeof(ICurrentContext) != typeRequest)
|
||||
{
|
||||
return new NoSpecimen();
|
||||
}
|
||||
|
||||
var obj = new Fixture().WithAutoNSubstitutions().Create<ICurrentContext>();
|
||||
obj.Organizations = context.Create<List<CurrentContentOrganization>>();
|
||||
return obj;
|
||||
public void Customize(IFixture fixture)
|
||||
{
|
||||
fixture.Customizations.Add(new CurrentContextBuilder());
|
||||
}
|
||||
}
|
||||
|
||||
internal class CurrentContextBuilder : ISpecimenBuilder
|
||||
{
|
||||
public object Create(object request, ISpecimenContext context)
|
||||
{
|
||||
if (context == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(context));
|
||||
}
|
||||
if (!(request is Type typeRequest))
|
||||
{
|
||||
return new NoSpecimen();
|
||||
}
|
||||
if (typeof(ICurrentContext) != typeRequest)
|
||||
{
|
||||
return new NoSpecimen();
|
||||
}
|
||||
|
||||
var obj = new Fixture().WithAutoNSubstitutions().Create<ICurrentContext>();
|
||||
obj.Organizations = context.Create<List<CurrentContentOrganization>>();
|
||||
return obj;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user