public void T_11_RowCycle_DirectCycle() { var root = new RowCycle(); root.SomeInt = 1234; root.InnerRow = root; //Direct cycle var rc = new RowConverter(); var doc = rc.RowToBSONDocument(root, "A"); //exception }
public void T_12_RowCycle_TransitiveCycle_1() { var root = new RowCycle(); root.SomeInt = 1234; root.InnerRow = new RowCycle(); root.InnerRow.SomeInt = 567; root.InnerRow.InnerRow = root; //TRANSITIVE(via another instance) CYCLE!!!! var rc = new RowConverter(); var doc = rc.RowToBSONDocument(root, "A"); //exception }
public void T_10_RowCycle_NoCycle() { var root = new RowCycle(); root.SomeInt = 1234; root.InnerRow = new RowCycle(); root.InnerRow.SomeInt = 567; root.InnerRow.InnerRow = null; //NO CYCLE!!!! var rc = new RowConverter(); var doc = rc.RowToBSONDocument(root, "A"); Console.WriteLine(doc.ToString()); var root2 = new RowCycle(); rc.BSONDocumentToRow(doc, root2, "A"); Assert.AreEqual(1234, root2.SomeInt); Assert.IsNotNull(root2.InnerRow); Assert.AreEqual(567, root2.InnerRow.SomeInt); }
public void T_13_RowCycle_TransitiveCycle_2() { var root = new RowCycle(); root.SomeInt = 1234; root.InnerRow = new RowCycle(); root.InnerRow.SomeInt = 567; root.InnerRow.InnerRow = new RowCycle(); root.InnerRow.InnerRow.SomeInt = 890; root.InnerRow.InnerRow.InnerRow = root.InnerRow; //TRANSITIVE(via another instance) CYCLE!!!! var rc = new RowConverter(); var doc = rc.RowToBSONDocument( root, "A" ); //exception }
public void T_11_RowCycle_DirectCycle() { var root = new RowCycle(); root.SomeInt = 1234; root.InnerRow = root; //Direct cycle var rc = new RowConverter(); var doc = rc.RowToBSONDocument( root, "A" ); //exception }
public void T_10_RowCycle_NoCycle() { var root = new RowCycle(); root.SomeInt = 1234; root.InnerRow = new RowCycle(); root.InnerRow.SomeInt = 567; root.InnerRow.InnerRow = null; //NO CYCLE!!!! var rc = new RowConverter(); var doc = rc.RowToBSONDocument( root, "A" ); Console.WriteLine(doc.ToString()); var root2 = new RowCycle(); rc.BSONDocumentToRow(doc, root2, "A"); Assert.AreEqual(1234, root2.SomeInt); Assert.IsNotNull( root2.InnerRow ); Assert.AreEqual(567, root2.InnerRow.SomeInt); }