Encapsulates information describing an Application Insights component.
This class matches the "Application" schema concept. We are intentionally calling it "Component" for consistency with terminology used by our portal and services and to encourage standardization of terminology within our organization. Once a consensus is reached, we will change type and property names to match.
Наследование: IJsonSerializable
 public void VersionCanBeChangedByUserToSpecifyVersionOfTheirApplication()
 {
     var tags = new Dictionary<string, string>();
     var component = new ComponentContext(tags);
     component.Version = "4.2";
     Assert.Equal("4.2", component.Version);
 }
        public void VersionSetsCorrectTagKeyAndValue()
        {
            IDictionary<string, string> tags = new Dictionary<string, string>();
            var component = new ComponentContext(tags);

            string componentVersion = "fakeVersion";
            component.Version = componentVersion;

            Assert.True(tags.Contains(new KeyValuePair<string, string>(ContextTagKeys.Keys.ApplicationVersion, componentVersion)));
        }
 public void VersionIsNullByDefaultToAvoidSendingItToEndpointUnnecessarily()
 {
     var tags = new Dictionary<string, string>();
     var component = new ComponentContext(tags);
     Assert.Null(component.Version);
 }