public void InitializeSetsTimestampPropertyOfGivenTelemetry()
 {
     var initializer = new TimestampPropertyInitializer();
     var telemetry = new StubTelemetry();
     initializer.Initialize(telemetry);
     Assert.True(DateTimeOffset.Now.Subtract(telemetry.Timestamp) < TimeSpan.FromMinutes(1));
 }
示例#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);
 }
示例#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);
        }