Example #1
0
        public void ReadingVersionWithNoManifestYieldsDefaultValue()
        {
            ComponentContextInitializer source = new ComponentContextInitializer();
            var telemetryContext = new TelemetryContext();

            Assert.Null(telemetryContext.Component.Version);

            using (new ManifestSaver())
            {
                ComponentContextReader.Instance = new TestComponentContextReader(null);
                source.Initialize(telemetryContext);
            }

            Assert.Equal(ComponentContextReader.UnknownComponentVersion, telemetryContext.Component.Version);
        }
        public void ReadingVersionWithNoManifestYieldsDefaultValue()
        {
            ComponentContextInitializer source = new ComponentContextInitializer();
            var telemetryContext = new TelemetryContext();

            Assert.Null(telemetryContext.Component.Version);

            using (new ManifestSaver())
            {
                ComponentContextReader.Instance = new TestComponentContextReader(null);
                source.Initialize(telemetryContext);
            }

            Assert.Equal(ComponentContextReader.UnknownComponentVersion, telemetryContext.Component.Version);
        }
Example #3
0
        public void ReadingVersionWithNoIdentityElementYieldsDefaultValue()
        {
            ComponentContextInitializer source = new ComponentContextInitializer();
            var telemetryContext = new TelemetryContext();

            Assert.Null(telemetryContext.Component.Version);

            using (new ManifestSaver())
            {
                XElement root = new XElement(XName.Get("Deployment", "http://schemas.microsoft.com/windowsphone/2012/deployment"));
                ComponentContextReader.Instance = new TestComponentContextReader(root);
                source.Initialize(telemetryContext);
            }

            Assert.Equal(ComponentContextReader.UnknownComponentVersion, telemetryContext.Component.Version);
        }
        public void ReadingVersionWithNoIdentityElementYieldsDefaultValue()
        {
            ComponentContextInitializer source = new ComponentContextInitializer();
            var telemetryContext = new TelemetryContext();

            Assert.Null(telemetryContext.Component.Version);

            using (new ManifestSaver())
            {
                XElement root = new XElement(XName.Get("Deployment", "http://schemas.microsoft.com/windowsphone/2012/deployment"));
                ComponentContextReader.Instance = new TestComponentContextReader(root);
                source.Initialize(telemetryContext);
            }

            Assert.Equal(ComponentContextReader.UnknownComponentVersion, telemetryContext.Component.Version);
        }