public void GivenZeroProvider_EventSubscribe_GetMustThrowException() { var root = new SavableConfigurationRoot(new IConfigurationProvider[0]); root.ConfigurationChanged += (_) => { }; Assert.ThrowsException <InvalidOperationException>(() => root["a"] = "1"); }
public void ConfigurationMutEqualInput_MustThrowException() { var root = new SavableConfigurationRoot(new IConfigurationProvider[0]); var watcher = new EmptyChangeWatcher(root); Assert.AreEqual(root, watcher.Configuration); watcher.Dispose(); }
public void CallCreateEmptyWatcherWithSavableConfig_MustReturnWatcher() { var config = new SavableConfigurationRoot(new IConfigurationProvider[0]); var watcher = ConfigurationExtensions.CreateEmptyWatcher(config); Assert.IsNotNull(watcher); watcher = ConfigurationExtensions.CreateEmptyWatcher((IConfiguration)config); Assert.IsNotNull(watcher); }
public MainWindow() { InitializeComponent(); var builder = new SavableConfiurationBuilder(); builder.AddJsonFile("app.json", true, true); root = builder.Build(); DataContext = ProxyHelper.Default.EnsureCreateProxWithAttribute <ThemeService>(root); root.BindTwoWay(DataContext, JsonChangeTransferCondition.Instance); }
public MainWindow() { InitializeComponent(); root = new ConfigurationBuilder() .AddJsonFile("app.json", true, true) .BuildSavable(); GoNormalBind(); GoProxy(); KeyDown += MainWindow_KeyDown; }
public Changes() { var builder = new SavableConfiurationBuilder(); builder.AddJsonFile("appsettings.json", true, false); root = builder.Build(); changeWatcher = new ChangeWatcher(root); var msbuilder = new ConfigurationBuilder(); msbuilder.AddJsonFile("appsettings.json", true, false); msroot = msbuilder.Build(); }
public void CallChangeInfos_MustThrowException() { var root = new SavableConfigurationRoot(new IConfigurationProvider[0]); Assert.ThrowsException <NotSupportedException>(() => new EmptyChangeWatcher(root).ChangeInfos); }