V10: fix build warnings in test projects (#12509)
* Run code cleanup * Dotnet format benchmarks project * Fix up Test.Common * Run dotnet format + manual cleanup * Run code cleanup for unit tests * Run dotnet format * Fix up errors * Manual cleanup of Unit test project * Update tests/Umbraco.Tests.Benchmarks/HexStringBenchmarks.cs Co-authored-by: Mole <nikolajlauridsen@protonmail.ch> * Update tests/Umbraco.Tests.Integration/Testing/TestDbMeta.cs Co-authored-by: Mole <nikolajlauridsen@protonmail.ch> * Update tests/Umbraco.Tests.Benchmarks/TypeFinderBenchmarks.cs Co-authored-by: Mole <nikolajlauridsen@protonmail.ch> * Update tests/Umbraco.Tests.Integration/Testing/UmbracoIntegrationTest.cs Co-authored-by: Mole <nikolajlauridsen@protonmail.ch> * Update tests/Umbraco.Tests.Integration/Umbraco.Core/Events/EventAggregatorTests.cs Co-authored-by: Mole <nikolajlauridsen@protonmail.ch> * Fix according to review * Fix after merge * Fix errors Co-authored-by: Nikolaj Geisle <niko737@edu.ucl.dk> Co-authored-by: Mole <nikolajlauridsen@protonmail.ch> Co-authored-by: Zeegaan <nge@umbraco.dk>
This commit is contained in:
@@ -9,61 +9,60 @@ using Umbraco.Cms.Core.Serialization;
|
||||
using Umbraco.Cms.Core.Services;
|
||||
using Umbraco.Cms.Core.Strings;
|
||||
|
||||
namespace Umbraco.Cms.Tests.Common.Builders
|
||||
namespace Umbraco.Cms.Tests.Common.Builders;
|
||||
|
||||
public class DataValueEditorBuilder<TParent> : ChildBuilderBase<TParent, IDataValueEditor>
|
||||
{
|
||||
public class DataValueEditorBuilder<TParent> : ChildBuilderBase<TParent, IDataValueEditor>
|
||||
private string _configuration;
|
||||
private bool? _hideLabel;
|
||||
private string _valueType;
|
||||
private string _view;
|
||||
|
||||
public DataValueEditorBuilder(TParent parentBuilder)
|
||||
: base(parentBuilder)
|
||||
{
|
||||
private string _configuration;
|
||||
private string _view;
|
||||
private bool? _hideLabel;
|
||||
private string _valueType;
|
||||
}
|
||||
|
||||
public DataValueEditorBuilder(TParent parentBuilder)
|
||||
: base(parentBuilder)
|
||||
public DataValueEditorBuilder<TParent> WithConfiguration(string configuration)
|
||||
{
|
||||
_configuration = configuration;
|
||||
return this;
|
||||
}
|
||||
|
||||
public DataValueEditorBuilder<TParent> WithView(string view)
|
||||
{
|
||||
_view = view;
|
||||
return this;
|
||||
}
|
||||
|
||||
public DataValueEditorBuilder<TParent> WithHideLabel(bool hideLabel)
|
||||
{
|
||||
_hideLabel = hideLabel;
|
||||
return this;
|
||||
}
|
||||
|
||||
public DataValueEditorBuilder<TParent> WithValueType(string valueType)
|
||||
{
|
||||
_valueType = valueType;
|
||||
return this;
|
||||
}
|
||||
|
||||
public override IDataValueEditor Build()
|
||||
{
|
||||
var configuration = _configuration;
|
||||
var view = _view;
|
||||
var hideLabel = _hideLabel ?? false;
|
||||
var valueType = _valueType ?? Guid.NewGuid().ToString();
|
||||
|
||||
return new DataValueEditor(
|
||||
Mock.Of<ILocalizedTextService>(),
|
||||
Mock.Of<IShortStringHelper>(),
|
||||
Mock.Of<IJsonSerializer>())
|
||||
{
|
||||
}
|
||||
|
||||
public DataValueEditorBuilder<TParent> WithConfiguration(string configuration)
|
||||
{
|
||||
_configuration = configuration;
|
||||
return this;
|
||||
}
|
||||
|
||||
public DataValueEditorBuilder<TParent> WithView(string view)
|
||||
{
|
||||
_view = view;
|
||||
return this;
|
||||
}
|
||||
|
||||
public DataValueEditorBuilder<TParent> WithHideLabel(bool hideLabel)
|
||||
{
|
||||
_hideLabel = hideLabel;
|
||||
return this;
|
||||
}
|
||||
|
||||
public DataValueEditorBuilder<TParent> WithValueType(string valueType)
|
||||
{
|
||||
_valueType = valueType;
|
||||
return this;
|
||||
}
|
||||
|
||||
public override IDataValueEditor Build()
|
||||
{
|
||||
var configuration = _configuration ?? null;
|
||||
var view = _view ?? null;
|
||||
var hideLabel = _hideLabel ?? false;
|
||||
var valueType = _valueType ?? Guid.NewGuid().ToString();
|
||||
|
||||
return new DataValueEditor(
|
||||
Mock.Of<ILocalizedTextService>(),
|
||||
Mock.Of<IShortStringHelper>(),
|
||||
Mock.Of<IJsonSerializer>())
|
||||
{
|
||||
Configuration = configuration,
|
||||
View = view,
|
||||
HideLabel = hideLabel,
|
||||
ValueType = valueType,
|
||||
};
|
||||
}
|
||||
Configuration = configuration,
|
||||
View = view,
|
||||
HideLabel = hideLabel,
|
||||
ValueType = valueType
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user