public void InitializeAssignsVersionToTelemetry()
 {
     var initializer = new ComponentVersionTelemetryInitializer(this.BuildConfigurationWithVersion());
     var telemetry = new RequestTelemetry();
     initializer.Initialize(telemetry);
     Assert.NotNull(telemetry.Context.Component.Version);
 }
 public void InitializeDoesNotThrowIfVersionDoesNotExist()
 {
     var config = new ConfigurationBuilder()
         .Build();
     var initializer = new ComponentVersionTelemetryInitializer(config);
     var telemetry = new RequestTelemetry();
     initializer.Initialize(telemetry);
 }
        public void InitializeDoesNotOverrideExistingVersion()
        {
            var initializer = new ComponentVersionTelemetryInitializer(this.BuildConfigurationWithVersion());
            var telemetry = new RequestTelemetry();
            telemetry.Context.Component.Version = "TestVersion";
            initializer.Initialize(telemetry);

            Assert.Equal("TestVersion", telemetry.Context.Component.Version);
        }
 public void InitializeDoesNotThrowIfRequestTelemetryIsUnavailable()
 {
     var initializer = new ComponentVersionTelemetryInitializer(this.BuildConfigurationWithVersion());
     initializer.Initialize(new RequestTelemetry());
 }