public void ContractMissingVersion()
        {
            string contents = @"<ApplicationPlatform name=`UAP` friendlyName=`Universal Application Platform` version=`1.0.0.0`>
                                  <DependentPlatform name=`UAP` version=`1.0.2.3` />
                                  <ContainedApiContracts>
                                    <ApiContract name=`System` />
                                  </ContainedApiContracts>
                                </ApplicationPlatform>";

            using (TemporaryPlatformManifest manifest = new TemporaryPlatformManifest(contents))
            {
                Assert.IsFalse(manifest.Manifest.ReadError);

                Assert.AreEqual(1, manifest.Manifest.DependentPlatforms.Count);
                PlatformManifest.DependentPlatform platform = manifest.Manifest.DependentPlatforms.First();
                Assert.AreEqual("UAP", platform.Name);
                Assert.AreEqual("1.0.2.3", platform.Version);

                Assert.AreEqual(1, manifest.Manifest.ApiContracts.Count);
                ApiContract contract = manifest.Manifest.ApiContracts.First();
                Assert.AreEqual("System", contract.Name);
                Assert.AreEqual(String.Empty, contract.Version);
            }
        }
Esempio n. 2
0
        public void ContractMissingVersion()
        {
            string contents = @"<ApplicationPlatform name=`UAP` friendlyName=`Universal Application Platform` version=`1.0.0.0`>
                                  <DependentPlatform name=`UAP` version=`1.0.2.3` />
                                  <ContainedApiContracts>
                                    <ApiContract name=`System` />
                                  </ContainedApiContracts>
                                </ApplicationPlatform>";

            using (TemporaryPlatformManifest manifest = new TemporaryPlatformManifest(contents))
            {
                manifest.Manifest.ReadError.ShouldBeFalse();

                manifest.Manifest.DependentPlatforms.Count.ShouldBe(1);
                PlatformManifest.DependentPlatform platform = manifest.Manifest.DependentPlatforms.First();
                platform.Name.ShouldBe("UAP");
                platform.Version.ShouldBe("1.0.2.3");

                manifest.Manifest.ApiContracts.Count.ShouldBe(1);
                ApiContract contract = manifest.Manifest.ApiContracts.First();
                contract.Name.ShouldBe("System");
                contract.Version.ShouldBe(string.Empty);
            }
        }