Пример #1
0
        public void AppxManifestFileShouldReturnAppropriateSourceIfAppxManifestIsProvided()
        {
            var    appxManifestPath = Path.Combine(Path.GetDirectoryName(typeof(TestableTestHostManager).GetTypeInfo().Assembly.GetAssemblyLocation()), @"..\..\..\..\TestAssets\UWPTestAssets\AppxManifest.xml");
            string source           = AppxManifestFile.GetApplicationExecutableName(appxManifestPath);

            Assert.AreEqual("UnitTestApp8.exe", source);
        }
Пример #2
0
        private string GetUwpSources(string uwpSource)
        {
            var doc = XDocument.Load(uwpSource);
            var ns  = doc.Root.Name.Namespace;

            string appxManifestPath = doc.Element(ns + "Project").
                                      Element(ns + "ItemGroup").
                                      Element(ns + "AppXManifest").
                                      Attribute("Include").Value;

            if (!Path.IsPathRooted(appxManifestPath))
            {
                appxManifestPath = Path.Combine(Path.GetDirectoryName(uwpSource), appxManifestPath);
            }

            return(AppxManifestFile.GetApplicationExecutableName(appxManifestPath));
        }