public void CanFormatInvolvedTablesWithAlternateKeys() { var involvedTables = new List <InvolvedTable> { new InvolvedTable( "Table1", new[] { new AlternateKeyRowReference("AAA"), new AlternateKeyRowReference("BBB") }, "KEY"), new InvolvedTable( "Table2", new[] { new AlternateKeyRowReference("111"), new AlternateKeyRowReference("222") }, "KEY") }; string formatted = IssueUtils.FormatInvolvedTables(involvedTables); Console.WriteLine(formatted); Assert.AreEqual("[Table1:KEY]AAA||BBB;[Table2:KEY]111||222", formatted); }
public void CanFormatInvolvedTablesWithOids() { var involvedTables = new List <InvolvedTable> { new InvolvedTable( "Table1", new[] { new OIDRowReference(1), new OIDRowReference(2) }), new InvolvedTable( "Table2", new[] { new OIDRowReference(1000), new OIDRowReference(1001) }) }; string formatted = IssueUtils.FormatInvolvedTables(involvedTables); Console.WriteLine(formatted); Assert.AreEqual("[Table1]1||2;[Table2]1000||1001", formatted); }
public void CanFormatInvolvedTableWithoutRows() { var involvedTables = new List <InvolvedTable> { new InvolvedTable("Table1", new RowReference[] { }) }; string formatted = IssueUtils.FormatInvolvedTables(involvedTables); Console.WriteLine(formatted); Assert.AreEqual("[Table1]", formatted); }
public void CanFormatInvolvedTablesWithoutRows() { var involvedTables = new List <InvolvedTable> { new InvolvedTable("Table1", new RowReference[] { }), new InvolvedTable("Table2", new RowReference[] { }, "KeyField"), new InvolvedTable("Table3", new RowReference[] { }) }; string formatted = IssueUtils.FormatInvolvedTables(involvedTables); Console.WriteLine(formatted); // field name is omitted (not used, there are no row references) Assert.AreEqual("[Table1];[Table2];[Table3]", formatted); }