Record() публичный Метод

Record the given value to the given monitor configuration, for the given time.
public Record ( string configName, System.DateTime time, double value, MonitorReductionType monitorReductionType ) : void
configName string Name of the config
time System.DateTime Time of the recrod
value double Value that is being recorded
monitorReductionType MonitorReductionType Reduction type that is being used
Результат void
Пример #1
0
            public void WhenHasResolutionAllLikeTimesShouldBeGrouped()
            {
                var monitorInfo = BuildDefaultMonitorInfo(1000);
                var recordMocks = BuildRecordMocks(monitorInfo);

                var recorder = new Recorder(recordMocks.Cache.Object, recordMocks.Settings.Object);
                recorder.Record("Test", new DateTime(1995, 06, 06, 1, 32, 23, 452), 1, MonitorReductionType.DefaultAccumulate);
                recorder.Record("Test", new DateTime(1995, 06, 06, 1, 32, 23, 453), 1, MonitorReductionType.DefaultAccumulate);
                recorder.Record("Test", new DateTime(1995, 06, 06, 1, 32, 23, 454), 1, MonitorReductionType.DefaultAccumulate);

                Assert.Equal(monitorInfo.MonitorRecords.Count, 1);
                Assert.Equal(monitorInfo.MonitorRecords[0].Number, 3);
            }
Пример #2
0
            public void ShouldThrowExceptionWhenNoSeedConfigIsFound()
            {
                var seeder = new Mock<IConfigSeed>();
                seeder.Setup(x => x.Seed("Test", MonitorReductionType.DefaultAccumulate)).Verifiable();

                var settings = BuildSettings();
                settings.SetupGet(x => x.Debug).Returns(true);
                settings.SetupGet(x => x.ConfigSeed).Returns(seeder.Object);

                var cache = new Mock<IDataCache>();

                var recorder = new Recorder(cache.Object, settings.Object);

                Assert.Throws<Exception>(() => recorder.Record("Test", DateTime.Now, 1, MonitorReductionType.DefaultAccumulate));

                seeder.VerifyAll();
            }