Example #1
0
        public void TestTryValidate(string manifestPath)
        {
            InsertionApi insertionApi = new InsertionApi();

            Assert.IsFalse(insertionApi.TryValidateManifestFile(manifestPath, out string details));
            Assert.IsFalse(string.IsNullOrWhiteSpace(details));
        }
Example #2
0
        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);
        }
Example #3
0
        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);
        }