Esempio n. 1
0
        public void CanGetInvolvedRowsKeyFastEnough()
        {
            var involvedRows = new List <InvolvedRow>
            {
                new InvolvedRow("Table2", 100),
                new InvolvedRow("Table1", 1000),
                new InvolvedRow("Table2", 200)
            };

            AssertFastEnough(() => ExceptionObjectUtils.GetKey(involvedRows), 10000, 0.1);
        }
Esempio n. 2
0
        private static void AssertEqualKeys([NotNull] ICollection <InvolvedRow> involvedRows)
        {
            string involvedRowsKey = ExceptionObjectUtils.GetKey(involvedRows);

            string involvedTablesKey = ExceptionObjectUtils.GetKey(
                IssueUtils.GetInvolvedTables(involvedRows));

            Console.WriteLine(@"Involved rows key:   [{0}]", involvedRowsKey);
            Console.WriteLine(@"Involved tables key: [{0}]", involvedTablesKey);

            Assert.AreEqual(involvedRowsKey, involvedTablesKey);
        }
Esempio n. 3
0
        public void CanIgnoreInvolvedRowTable()
        {
            var involvedRows = new List <InvolvedRow>
            {
                new InvolvedRow("Table2", 100),
                new InvolvedRow("Table1", 1000),
                new InvolvedRow("Table2", 200)
            };

            string key = ExceptionObjectUtils.GetKey(involvedRows, t => t == "Table1");

            Console.WriteLine(key);

            Assert.AreEqual("Table2:100:200;", key);
        }
Esempio n. 4
0
        public void CanIgnoreInvolvedTable()
        {
            var involvedTables = new List <InvolvedTable>
            {
                new InvolvedTable("Table1",
                                  new[]
                {
                    new OIDRowReference(100)
                }),
                new InvolvedTable("Table2",
                                  new[]
                {
                    new OIDRowReference(200),
                    new OIDRowReference(100)
                }),
            };

            string key = ExceptionObjectUtils.GetKey(involvedTables, t => t == "Table1");

            Console.WriteLine(key);

            Assert.AreEqual("Table2:100:200;", key);
        }