public static void ExamineFactDifferences()
        {
            // load same instance twice
            var path           = Path.Combine("data", "ars.xbrl");
            var firstInstance  = Instance.FromFile(path);
            var secondInstance = Instance.FromFile(path);

            // change some facts  on the second instance
            firstInstance.Facts[0].Value    = "DEADBEED";
            firstInstance.Facts[1].Decimals = "16";

            secondInstance.Facts[0].Value    = "FOOBAR";
            secondInstance.Facts[1].Decimals = "9";

            // change some context members
            secondInstance.Contexts[4].AddExplicitMember("AO", "s2c_AO:x0");
            secondInstance.Contexts[5].AddExplicitMember("RT", "s2c_RT:x52");

            // generate raw differences
            var report = InstanceComparer.ReportObjects(firstInstance, secondInstance, ComparisonTypes.All, BasicComparisons.All);

            // should give negative result because differences were found
            Assert.False(report.Result);
            // should report both facts for both instances
            Assert.Equal(2, report.Facts.Item1.Count);
            Assert.Equal(2, report.Facts.Item2.Count);

            // try to match the facts
            var factReport = FactReport.FromReport(report);

            Assert.NotNull(factReport.Matches);
        }
        public static void CompareTotallyDifferentInstancesReportObjects()
        {
            var firstPath  = Path.Combine("data", "reference.xbrl");
            var secondPath = Path.Combine("data", "ars.xbrl");
            var report     = InstanceComparer.ReportObjects(firstPath, secondPath);

            Assert.False(report.Result);
        }
        public static void CompareLargeInstanceMinorDifferenceInFactReportObjects()
        {
            // load same instance twice
            var path           = Path.Combine("data", "ars.xbrl");
            var firstInstance  = Instance.FromFile(path);
            var secondInstance = Instance.FromFile(path);

            // change one fact in both instances
            // original is 0
            firstInstance.Facts[33099].Value  = "FOOBAR";
            secondInstance.Facts[33099].Value = "DEADBEEF";
            var report = InstanceComparer.ReportObjects(firstInstance, secondInstance, ComparisonTypes.All, BasicComparisons.All);

            // not the same anymore
            Assert.False(report.Result);

            // one fact is different, report should reflect this once per instance
            Assert.Single(report.Facts.Item1);
            Assert.Single(report.Facts.Item2);
        }