* Add a way to configure IUmbracobuilder on a per testcase basis * New logic for invariantVariantMerging * bugfix * Undo formatting changes * Undo more automatic formatting * Last automatic formatting correction * Cleanup ConfigureBuilderAttribute * Made propertyEditor tests internal
31 lines
1.0 KiB
C#
31 lines
1.0 KiB
C#
using NUnit.Framework;
|
|
|
|
namespace Umbraco.Cms.Tests.Integration.Attributes;
|
|
|
|
[AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = true)]
|
|
public class ConfigureBuilderAttribute : Attribute
|
|
{
|
|
public string ActionName { get; set; }
|
|
|
|
public void Execute(IUmbracoBuilder builder)
|
|
{
|
|
// todo allow to find methods from parents
|
|
Type.GetType(TestContext.CurrentContext.Test.ClassName).GetMethods().First(method => method.Name == ActionName)
|
|
.Invoke(null, [builder]);
|
|
}
|
|
}
|
|
|
|
[AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = true)]
|
|
public class ConfigureBuilderTestCaseAttribute : Attribute
|
|
{
|
|
public string ActionName { get; set; }
|
|
|
|
public int IndexOfParameter { get; set; }
|
|
|
|
public void Execute(IUmbracoBuilder builder)
|
|
{
|
|
Type.GetType(TestContext.CurrentContext.Test.ClassName).GetMethods().First(method => method.Name == ActionName)
|
|
.Invoke(null, [builder, TestContext.CurrentContext.Test.Arguments[IndexOfParameter]]);
|
|
}
|
|
}
|