public void TestTryValidate(string manifestPath) { InsertionApi insertionApi = new InsertionApi(); Assert.IsFalse(insertionApi.TryValidateManifestFile(manifestPath, out string details)); Assert.IsFalse(string.IsNullOrWhiteSpace(details)); }
private List <Asset> LoadManifestAssets() { InsertionApi insertionApi = new InsertionApi(); bool result = insertionApi.TryExtractManifestAssets(GetManifestFilePath(), out List <Asset> assets, out string error); Assert.IsTrue(result, error); Assert.IsTrue(string.IsNullOrWhiteSpace(error), error); Assert.IsNotNull(assets); Assert.AreNotEqual(assets.Count, 0); return(assets); }
public void TestLoadNonJsonFile() { string fakeManifestPath = Path.Combine(Environment.CurrentDirectory, "fakeManifest.json"); File.WriteAllText(fakeManifestPath, "some content that is not json"); InsertionApi insertionApi = new InsertionApi(); bool result = insertionApi.TryExtractManifestAssets(fakeManifestPath, out List <Asset> assets, out string error); Assert.IsFalse(result); Assert.IsFalse(string.IsNullOrWhiteSpace(error)); Assert.IsNotNull(assets); Assert.AreEqual(0, assets.Count); }