예제 #1
0
            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"));
            }
예제 #2
0
            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();
            }