1
0
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:
Oscar Hinton
2022-08-29 15:40:59 +02:00
committed by GitHub
parent 2b2f9fafd2
commit 194c695cd0
104 changed files with 4098 additions and 1898 deletions

View File

@ -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();
}
}