public static bool DiffStressTest(string pathToMsApp)
        {
            (CanvasDocument doc1, var errors) = CanvasDocument.LoadFromMsapp(pathToMsApp);
            errors.ThrowOnErrors();

            return(HasNoDeltas(doc1, doc1));
        }
        public static bool TestClone(string pathToMsApp)
        {
            (CanvasDocument doc1, var errors) = CanvasDocument.LoadFromMsapp(pathToMsApp);
            errors.ThrowOnErrors();

            var docClone = new CanvasDocument(doc1);

            return(HasNoDeltas(doc1, docClone, strict: true));
        }
        // Unpack, delete the entropy dirs, repack.
        public static CanvasDocument RemoveEntropy(string pathToMsApp)
        {
            using (var temp1 = new TempDir())
            {
                (CanvasDocument doc1, var errors) = CanvasDocument.LoadFromMsapp(pathToMsApp);
                errors.ThrowOnErrors();

                doc1.SaveToSources(temp1.Dir);

                var entropyDir = Path.Combine(temp1.Dir, "Entropy");
                if (!Directory.Exists(entropyDir))
                {
                    throw new Exception($"Missing entropy dir: " + entropyDir);
                }

                Directory.Delete(entropyDir, recursive: true);

                (var doc2, var errors2) = CanvasDocument.LoadFromSources(temp1.Dir);
                errors.ThrowOnErrors();

                return(doc2);
            }
        }
        public static bool MergeStressTest(string pathToMsApp1, string pathToMsApp2)
        {
            try
            {
                (CanvasDocument doc1, var errors) = CanvasDocument.LoadFromMsapp(pathToMsApp1);
                errors.ThrowOnErrors();

                (var doc2, var errors2) = CanvasDocument.LoadFromMsapp(pathToMsApp2);
                errors2.ThrowOnErrors();

                var doc1New = CanvasMerger.Merge(doc1, doc2, doc2);
                var ok1     = HasNoDeltas(doc1, doc1New);

                var doc2New = CanvasMerger.Merge(doc2, doc1, doc1);
                var ok2     = HasNoDeltas(doc2, doc2New);

                return(ok1 && ok2);
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
                return(false);
            }
        }