2020-12-20 08:36:11 +01:00
|
|
|
// Copyright (c) Umbraco.
|
|
|
|
|
// See LICENSE for more details.
|
|
|
|
|
|
2020-06-24 22:00:27 +02:00
|
|
|
using AutoFixture.NUnit3;
|
|
|
|
|
|
2022-06-21 08:09:38 +02:00
|
|
|
namespace Umbraco.Cms.Tests.UnitTests.AutoFixture;
|
|
|
|
|
|
|
|
|
|
[AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor)]
|
|
|
|
|
public class AutoMoqDataAttribute : AutoDataAttribute
|
2020-06-24 22:00:27 +02:00
|
|
|
{
|
2022-06-21 08:09:38 +02:00
|
|
|
/// <summary>
|
|
|
|
|
/// Uses AutoFixture to automatically mock (using Moq) the injected types. E.g when injecting interfaces.
|
|
|
|
|
/// AutoFixture is used to generate concrete types. If the concrete type required some types injected, the
|
|
|
|
|
/// [Frozen] can be used to ensure the same variable is injected and available as parameter for the test
|
|
|
|
|
/// </summary>
|
|
|
|
|
public AutoMoqDataAttribute()
|
|
|
|
|
: base(UmbracoAutoMoqFixtureFactory.CreateDefaultFixture)
|
2020-06-24 22:00:27 +02:00
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
}
|