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); }
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)); }