2022-06-21 08:09:38 +02:00
|
|
|
using System;
|
2021-09-23 11:30:25 +02:00
|
|
|
using Microsoft.Extensions.Options;
|
|
|
|
|
|
2022-06-21 08:09:38 +02:00
|
|
|
namespace Umbraco.Cms.Tests.Common;
|
|
|
|
|
|
|
|
|
|
public class TestOptionsMonitor<T> : IOptionsMonitor<T> where T : class
|
2021-09-23 11:30:25 +02:00
|
|
|
{
|
2022-06-21 08:09:38 +02:00
|
|
|
public TestOptionsMonitor(T currentValue) => CurrentValue = currentValue;
|
2021-09-23 11:30:25 +02:00
|
|
|
|
2022-06-21 08:09:38 +02:00
|
|
|
public T Get(string name) => CurrentValue;
|
2021-09-23 11:30:25 +02:00
|
|
|
|
2022-06-21 08:09:38 +02:00
|
|
|
public IDisposable OnChange(Action<T, string> listener) => null;
|
2021-09-23 11:30:25 +02:00
|
|
|
|
2022-06-21 08:09:38 +02:00
|
|
|
public T CurrentValue { get; }
|
2021-09-23 11:30:25 +02:00
|
|
|
}
|