parent
d8eac2e381
commit
6820e785d9
@ -0,0 +1,11 @@
|
||||
using AutoFixture.NUnit3;
|
||||
|
||||
namespace TestLibrary.AutoFixture;
|
||||
|
||||
public class AutoMockDataAttribute : AutoDataAttribute
|
||||
{
|
||||
public AutoMockDataAttribute()
|
||||
: base(NSubstituteFixture.Create)
|
||||
{
|
||||
}
|
||||
}
|
@ -0,0 +1,14 @@
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using AutoFixture.NUnit3;
|
||||
|
||||
namespace TestLibrary.AutoFixture;
|
||||
|
||||
public class InlineAutoMockDataAttribute : InlineAutoDataAttribute
|
||||
{
|
||||
[SuppressMessage("Design", "CA1019", MessageId = "Define accessors for attribute arguments",
|
||||
Justification = "The parameter is forwarded to the base class and not used directly")]
|
||||
public InlineAutoMockDataAttribute(params object[] parameters)
|
||||
: base(NSubstituteFixture.Create, parameters)
|
||||
{
|
||||
}
|
||||
}
|
@ -0,0 +1,22 @@
|
||||
using AutoFixture;
|
||||
using AutoFixture.AutoNSubstitute;
|
||||
|
||||
namespace TestLibrary.AutoFixture;
|
||||
|
||||
public static class NSubstituteFixture
|
||||
{
|
||||
public static Fixture Create()
|
||||
{
|
||||
var fixture = new Fixture()
|
||||
{
|
||||
OmitAutoProperties = true
|
||||
};
|
||||
|
||||
fixture.Customize(new AutoNSubstituteCustomization
|
||||
{
|
||||
ConfigureMembers = true
|
||||
});
|
||||
|
||||
return fixture;
|
||||
}
|
||||
}
|
Loading…
Reference in new issue