mirror of
https://github.com/bitwarden/server.git
synced 2025-06-30 07:36:14 -05:00
[SM-151] Move EF Dapper tests to Infrastructure.EFIntegration.Test (#2204)
This commit is contained in:
@ -1,30 +1,7 @@
|
||||
using System.Reflection;
|
||||
using AutoFixture;
|
||||
using AutoFixture.Kernel;
|
||||
using AutoFixture.Xunit2;
|
||||
using Bit.Test.Common.Helpers.Factories;
|
||||
using AutoFixture;
|
||||
|
||||
namespace Bit.Test.Common.AutoFixture
|
||||
{
|
||||
public class GlobalSettingsBuilder : ISpecimenBuilder
|
||||
{
|
||||
public object Create(object request, ISpecimenContext context)
|
||||
{
|
||||
if (context == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(context));
|
||||
}
|
||||
|
||||
var pi = request as ParameterInfo;
|
||||
var fixture = new Fixture();
|
||||
|
||||
if (pi == null || pi.ParameterType != typeof(Bit.Core.Settings.GlobalSettings))
|
||||
return new NoSpecimen();
|
||||
|
||||
return GlobalSettingsFactory.GlobalSettings;
|
||||
}
|
||||
}
|
||||
|
||||
public class GlobalSettings : ICustomization
|
||||
{
|
||||
public void Customize(IFixture fixture)
|
||||
@ -36,9 +13,4 @@ namespace Bit.Test.Common.AutoFixture
|
||||
.Without(s => s.DataProtection));
|
||||
}
|
||||
}
|
||||
|
||||
public class GlobalSettingsCustomizeAttribute : CustomizeAttribute
|
||||
{
|
||||
public override ICustomization GetCustomization(ParameterInfo parameter) => new GlobalSettings();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user