Files
Umbraco-CMS/tests/Umbraco.Tests.Common/TestOptionsMonitor.cs
2021-10-18 08:29:43 +01:00

17 lines
429 B
C#

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; }
}
}