2023-01-31 09:46:45 +01:00
|
|
|
// 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;
|
|
|
|
|
|
|
|
|
|
public PartialViewBuilder WithPath(string path)
|
|
|
|
|
{
|
|
|
|
|
_path = path;
|
|
|
|
|
return this;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public PartialViewBuilder WithContent(string content)
|
|
|
|
|
{
|
|
|
|
|
_content = content;
|
|
|
|
|
return this;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override IPartialView Build()
|
|
|
|
|
{
|
|
|
|
|
var path = _path ?? string.Empty;
|
|
|
|
|
var content = _content ?? string.Empty;
|
|
|
|
|
|
2024-02-29 15:11:06 +01:00
|
|
|
return new PartialView(path) { Content = content };
|
2023-01-31 09:46:45 +01:00
|
|
|
}
|
|
|
|
|
}
|