public void ShouldThrowExceptionIfInfoNotFound() { var settings = BuildSettings(); settings.SetupGet(x => x.Debug).Returns(true); var monitorInfoDictionary = new ConcurrentDictionary<string, MonitorInfo>(); var cache = new Mock<IDataCache>(); cache.SetupGet(x => x.MonitorInfo).Returns(monitorInfoDictionary); var flusher = new RecordFlush(null, cache.Object, null, null, null, settings.Object); Assert.Throws<ArgumentException>(() => flusher.Flush("Test")); }
public void ShouldBeAbleToFlush() { var testData = PopulateTestData(false); testData.Connection.Setup(x => x.Close()).Verifiable(); var flusher = new RecordFlush(testData.DefineDefaults.Object, testData.Cache.Object, testData.Storage.Object, testData.Logic.Object, testData.DbProviderFactory.Object, testData.Settings.Object); flusher.Flush("Test"); testData.Verify(); }