Пример #1
0
        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
        }
Пример #2
0
        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
        }
Пример #3
0
        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);
        }
Пример #4
0
        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 DataDocConverter();

            var doc = rc.DataDocToBSONDocument(root, "A");

            doc.ToString().See();

            var root2 = new RowCycle();

            rc.BSONDocumentToDataDoc(doc, root2, "A");

            Aver.AreEqual(1234, root2.SomeInt);
            Aver.IsNotNull(root2.InnerRow);
            Aver.AreEqual(567, root2.InnerRow.SomeInt);
        }
Пример #5
0
      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
      }
Пример #6
0
      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
      }
Пример #7
0
      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);
      }