* Update gitignore * Move csproj * Update project references * Update solutions * Update build scripts * Tests used to share editorconfig with projects in src * Fix broken tests. * Stop copying around .editorconfig merged root one with linting * csharp_style_expression_bodied -> suggestion * Move StyleCop rulesets to matching directories and update shared build properties * Remove legacy build files, update NuGet.cofig and solution files * Restore myget source * Clean up .gitignore * Update .gitignore * Move new test classes to tests after merge * Gitignore + nuget config * Move new test Co-authored-by: Ronald Barendse <ronald@barend.se>
44 lines
1.1 KiB
C#
44 lines
1.1 KiB
C#
// Copyright (c) Umbraco.
|
|
// See LICENSE for more details.
|
|
|
|
using NUnit.Framework;
|
|
using Umbraco.Cms.Core.Cache;
|
|
using Umbraco.Cms.Core.Macros;
|
|
using Umbraco.Cms.Web.Common.Macros;
|
|
|
|
namespace Umbraco.Cms.Tests.UnitTests.Umbraco.Web.Common.Macros
|
|
{
|
|
[TestFixture]
|
|
public class MacroTests
|
|
{
|
|
[SetUp]
|
|
public void Setup()
|
|
{
|
|
// We DO want cache enabled for these tests
|
|
var cacheHelper = new AppCaches(
|
|
new ObjectCacheAppCache(),
|
|
NoAppCache.Instance,
|
|
new IsolatedCaches(type => new ObjectCacheAppCache()));
|
|
}
|
|
|
|
[TestCase("anything", true)]
|
|
[TestCase("", false)]
|
|
public void Macro_Is_File_Based(string macroSource, bool expectedNonNull)
|
|
{
|
|
var model = new MacroModel
|
|
{
|
|
MacroSource = macroSource
|
|
};
|
|
var filename = MacroRenderer.GetMacroFileName(model);
|
|
if (expectedNonNull)
|
|
{
|
|
Assert.IsNotNull(filename);
|
|
}
|
|
else
|
|
{
|
|
Assert.IsNull(filename);
|
|
}
|
|
}
|
|
}
|
|
}
|