You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
733 B
25 lines
733 B
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; |
|
}) |
|
{ } |
|
} |
|
}
|
|
|