Moved new test classes
This commit is contained in:
16
tests/Umbraco.Tests.Common/TestOptionsMonitor.cs
Normal file
16
tests/Umbraco.Tests.Common/TestOptionsMonitor.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
using System;
|
||||
using Microsoft.Extensions.Options;
|
||||
|
||||
namespace Umbraco.Cms.Tests.Common
|
||||
{
|
||||
public class TestOptionsMonitor<T> : IOptionsMonitor<T> where T : class
|
||||
{
|
||||
public TestOptionsMonitor(T currentValue) => CurrentValue = currentValue;
|
||||
|
||||
public T Get(string name) => CurrentValue;
|
||||
|
||||
public IDisposable OnChange(Action<T, string> listener) => null;
|
||||
|
||||
public T CurrentValue { get; }
|
||||
}
|
||||
}
|
||||
11
tests/Umbraco.Tests.Common/TestOptionsSnapshot.cs
Normal file
11
tests/Umbraco.Tests.Common/TestOptionsSnapshot.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
using Microsoft.Extensions.Options;
|
||||
|
||||
namespace Umbraco.Cms.Tests.Common
|
||||
{
|
||||
public class TestOptionsSnapshot<T> : IOptionsSnapshot<T> where T : class
|
||||
{
|
||||
public TestOptionsSnapshot(T value) => Value = value;
|
||||
public T Value { get; }
|
||||
public T Get(string name) => Value;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user