1
0
mirror of https://github.com/bitwarden/mobile synced 2024-12-25 00:12:24 +01:00
Bitwarden-app-android-iphon.../test/Common/AutoFixture/Attributes/CustomAutoDataAttribute.cs
2022-04-26 17:21:17 +02:00

26 lines
733 B
C#

using System;
using System.Linq;
using AutoFixture;
using AutoFixture.Xunit2;
namespace Bit.Test.Common.AutoFixture.Attributes
{
public class CustomAutoDataAttribute : AutoDataAttribute
{
public CustomAutoDataAttribute(params Type[] iCustomizationTypes) : this(iCustomizationTypes
.Select(t => (ICustomization)Activator.CreateInstance(t)).ToArray())
{ }
public CustomAutoDataAttribute(params ICustomization[] customizations) : base(() =>
{
var fixture = new Fixture();
foreach (var customization in customizations)
{
fixture.Customize(customization);
}
return fixture;
})
{ }
}
}