public void StartAsync_FeatureToggleDisabled() { var diskWatcher = new FakeDiskWatcher(); var appSettings = new AppSettings { UseDiskWatcher = false }; new DiskWatcherBackgroundService(diskWatcher, appSettings, new FakeIWebLogger()).StartAsync(CancellationToken .None); Assert.AreEqual(0, diskWatcher.AddedItems.Count); }
public void StartAsync_Enabled() { var diskWatcher = new FakeDiskWatcher(); var appSettings = new AppSettings { UseDiskWatcher = true }; new DiskWatcherBackgroundService(diskWatcher, appSettings, new FakeIWebLogger()).StartAsync(CancellationToken .None); Assert.AreEqual(appSettings.StorageFolder, diskWatcher.AddedItems.FirstOrDefault()); }