public void InitializeSetsTimestampPropertyOfGivenTelemetry()
 {
     var initializer = new TimestampPropertyInitializer();
     var telemetry = new StubTelemetry();
     initializer.Initialize(telemetry);
     Assert.True(DateTimeOffset.Now.Subtract(telemetry.Timestamp) < TimeSpan.FromMinutes(1));
 }
Esempio n. 2
0
        public void InitializeSetsTimestampPropertyOfGivenTelemetry()
        {
            var initializer = new TimestampPropertyInitializer();
            var telemetry   = new StubTelemetry();

            initializer.Initialize(telemetry);
            Assert.True(DateTimeOffset.Now.Subtract(telemetry.Timestamp) < TimeSpan.FromMinutes(1));
        }
 public void InitializeDoesNotOverrideTimestampSpecifiedExplicitly()
 {
     var initializer = new TimestampPropertyInitializer();
     var expected = new DateTimeOffset(new DateTime(42));
     var telemetry = new StubTelemetry { Timestamp = expected };
     initializer.Initialize(telemetry);
     Assert.Equal(expected, telemetry.Timestamp);
 }
Esempio n. 4
0
        public void InitializeDoesNotOverrideTimestampSpecifiedExplicitly()
        {
            var initializer = new TimestampPropertyInitializer();
            var expected    = new DateTimeOffset(new DateTime(42));
            var telemetry   = new StubTelemetry {
                Timestamp = expected
            };

            initializer.Initialize(telemetry);
            Assert.Equal(expected, telemetry.Timestamp);
        }