public void EmptyManifestLocation() { string manifestDirectory = null; try { manifestDirectory = FileUtilities.GetTemporaryDirectory(); PlatformManifest manifest = new PlatformManifest(manifestDirectory); Assert.IsTrue(manifest.ReadError); } finally { if (manifestDirectory != null) { FileUtilities.DeleteDirectoryNoThrow(manifestDirectory, recursive: true); } } }
public void ManifestLocationHasNoPlatformXml() { string manifestDirectory = null; try { manifestDirectory = FileUtilities.GetTemporaryDirectory(); File.WriteAllText(Path.Combine(manifestDirectory, "SomeOtherFile.xml"), "hello"); PlatformManifest manifest = new PlatformManifest(manifestDirectory); Assert.IsTrue(manifest.ReadError); } finally { if (manifestDirectory != null) { FileUtilities.DeleteDirectoryNoThrow(manifestDirectory, recursive: true); } } }
/// <summary> /// Constructor /// </summary> public TemporaryPlatformManifest(string contents) { manifestDirectory = FileUtilities.GetTemporaryDirectory(); File.WriteAllText(Path.Combine(manifestDirectory, "Platform.xml"), ObjectModelHelpers.CleanupFileContents(contents)); Manifest = new PlatformManifest(manifestDirectory); }
public void InvalidManifestLocation() { PlatformManifest manifest = new PlatformManifest("|||||||"); Assert.IsTrue(manifest.ReadError); }