Uses URL path separator when generating UDIs for files nested in folders. (#13689)
This commit is contained in:
41
tests/Umbraco.Tests.Common/Builders/PartialViewBuilder.cs
Normal file
41
tests/Umbraco.Tests.Common/Builders/PartialViewBuilder.cs
Normal file
@@ -0,0 +1,41 @@
|
||||
// Copyright (c) Umbraco.
|
||||
// See LICENSE for more details.
|
||||
|
||||
using Umbraco.Cms.Core.Models;
|
||||
|
||||
namespace Umbraco.Cms.Tests.Common.Builders;
|
||||
|
||||
public class PartialViewBuilder
|
||||
: BuilderBase<IPartialView>
|
||||
{
|
||||
private string _path;
|
||||
private string _content;
|
||||
private PartialViewType _viewType = PartialViewType.Unknown;
|
||||
|
||||
public PartialViewBuilder WithPath(string path)
|
||||
{
|
||||
_path = path;
|
||||
return this;
|
||||
}
|
||||
|
||||
public PartialViewBuilder WithContent(string content)
|
||||
{
|
||||
_content = content;
|
||||
return this;
|
||||
}
|
||||
|
||||
public PartialViewBuilder WithViewType(PartialViewType viewType)
|
||||
{
|
||||
_viewType = viewType;
|
||||
return this;
|
||||
}
|
||||
|
||||
public override IPartialView Build()
|
||||
{
|
||||
var path = _path ?? string.Empty;
|
||||
var content = _content ?? string.Empty;
|
||||
var viewType = _viewType;
|
||||
|
||||
return new PartialView(viewType, path) { Content = content };
|
||||
}
|
||||
}
|
||||
33
tests/Umbraco.Tests.Common/Builders/ScriptBuilder.cs
Normal file
33
tests/Umbraco.Tests.Common/Builders/ScriptBuilder.cs
Normal file
@@ -0,0 +1,33 @@
|
||||
// Copyright (c) Umbraco.
|
||||
// See LICENSE for more details.
|
||||
|
||||
using Umbraco.Cms.Core.Models;
|
||||
|
||||
namespace Umbraco.Cms.Tests.Common.Builders;
|
||||
|
||||
public class ScriptBuilder
|
||||
: BuilderBase<Script>
|
||||
{
|
||||
private string _path;
|
||||
private string _content;
|
||||
|
||||
public ScriptBuilder WithPath(string path)
|
||||
{
|
||||
_path = path;
|
||||
return this;
|
||||
}
|
||||
|
||||
public ScriptBuilder WithContent(string content)
|
||||
{
|
||||
_content = content;
|
||||
return this;
|
||||
}
|
||||
|
||||
public override Script Build()
|
||||
{
|
||||
var path = _path ?? string.Empty;
|
||||
var content = _content ?? string.Empty;
|
||||
|
||||
return new Script(path) { Content = content };
|
||||
}
|
||||
}
|
||||
@@ -8,8 +8,8 @@ namespace Umbraco.Cms.Tests.Common.Builders;
|
||||
public class StylesheetBuilder
|
||||
: BuilderBase<Stylesheet>
|
||||
{
|
||||
private string _content;
|
||||
private string _path;
|
||||
private string _content;
|
||||
|
||||
public StylesheetBuilder WithPath(string path)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user