Exemplo n.º 1
0
        public void AtomicMonotonicWinApiTimestampGenerator_Should_Log_When_Drifting_Above_Threshold()
        {
            var loggerHandler = new TestHelper.TestLoggerHandler();
            var generator     = new AtomicMonotonicWinApiTimestampGenerator(80, 1000, new Logger(loggerHandler));

            TimestampGeneratorLogDriftingTest(generator, loggerHandler);
        }
Exemplo n.º 2
0
        public void AtomicMonotonicWinApiTimestampGenerator_Should_Log_After_Cooldown()
        {
            var loggerHandler = new TestHelper.TestLoggerHandler();
            var generator     = new AtomicMonotonicWinApiTimestampGenerator(80, 1000, new Logger(loggerHandler));

            TimestampGeneratorLogAfterCooldownTest(generator, loggerHandler);
        }
Exemplo n.º 3
0
        public void AtomicMonotonicWinApiTimestampGenerator_Value_Should_Be_Close_To_Base_Class()
        {
            // The accuracy of both should be within a 15.6ms range
            var generator1 = new AtomicMonotonicTimestampGenerator();
            var generator2 = new AtomicMonotonicWinApiTimestampGenerator();

            Assert.Less(Math.Abs(generator1.Next() - generator2.Next()), 20000);
        }
Exemplo n.º 4
0
        public void AtomicMonotonicWinApiTimestampGenerator_Next_Should_Log_When_Drifting_Above_Threshold()
        {
            var minLogInterval = 2500;
            var loggerHandler  = new TestHelper.TestLoggerHandler();
            var generator      = new AtomicMonotonicWinApiTimestampGenerator(5, minLogInterval, new Logger(loggerHandler));

            TimestampGeneratorLogDriftingTest(generator, loggerHandler, minLogInterval);
        }