2020-12-05 11:12:55 +01:00
|
|
|
// Copyright (c) Umbraco.
|
|
|
|
|
// See LICENSE for more details.
|
|
|
|
|
|
2021-02-18 11:06:02 +01:00
|
|
|
using Umbraco.Cms.Core.Models;
|
2020-04-04 09:25:50 +02:00
|
|
|
|
2022-06-21 08:09:38 +02:00
|
|
|
namespace Umbraco.Cms.Tests.Common.Builders;
|
|
|
|
|
|
|
|
|
|
public class StylesheetBuilder
|
|
|
|
|
: BuilderBase<Stylesheet>
|
2020-04-04 09:25:50 +02:00
|
|
|
{
|
2022-06-21 08:09:38 +02:00
|
|
|
private string _path;
|
2023-01-31 09:46:45 +01:00
|
|
|
private string _content;
|
2020-04-04 09:25:50 +02:00
|
|
|
|
2022-06-21 08:09:38 +02:00
|
|
|
public StylesheetBuilder WithPath(string path)
|
|
|
|
|
{
|
|
|
|
|
_path = path;
|
|
|
|
|
return this;
|
|
|
|
|
}
|
2020-04-04 09:25:50 +02:00
|
|
|
|
2022-06-21 08:09:38 +02:00
|
|
|
public StylesheetBuilder WithContent(string content)
|
|
|
|
|
{
|
|
|
|
|
_content = content;
|
|
|
|
|
return this;
|
|
|
|
|
}
|
2020-04-04 09:25:50 +02:00
|
|
|
|
2022-06-21 08:09:38 +02:00
|
|
|
public override Stylesheet Build()
|
|
|
|
|
{
|
|
|
|
|
var path = _path ?? string.Empty;
|
|
|
|
|
var content = _content ?? string.Empty;
|
2020-04-04 09:25:50 +02:00
|
|
|
|
2022-06-21 08:09:38 +02:00
|
|
|
return new Stylesheet(path) { Content = content };
|
2020-04-04 09:25:50 +02:00
|
|
|
}
|
|
|
|
|
}
|