public void CountPanelsSubType() { System.Windows.Forms.Form form = new System.Windows.Forms.Form(); _TestSingleTon.Instance._SetupForLayoutPanelTests(); //FAKE_LayoutPanel panel = new FAKE_LayoutPanel(CoreUtilities.Constants.BLANK, false); Assert.False(MasterOfLayouts.ExistsByGUID("testlayout")); _w.output("here"); //-- do unit tests counting store 6 textboxes and know this (countbytype) //_setupforlayoutests (); _w.output("here"); int count = 25; // FakeLayoutDatabase layout = new FakeLayoutDatabase ("testguid"); FAKE_LayoutPanel layoutPanel = new FAKE_LayoutPanel(CoreUtilities.Constants.BLANK, false); layoutPanel.NewLayout("testlayout", false, null); form.Controls.Add(layoutPanel); form.Show(); NoteDataXML note = new NoteDataXML(); for (int i = 0; i < count; i++) { note.Caption = "boo" + i.ToString(); layoutPanel.AddNote(note); note.CreateParent(layoutPanel); } _w.output(String.Format("{0} Notes in Layout before save", layoutPanel.GetAllNotes().Count.ToString())); for (int i = 0; i < 6; i++) { note = new NoteDataXML_Panel(); note.Caption = "Panel"; layoutPanel.AddNote(note); note.CreateParent(layoutPanel); ((NoteDataXML_Panel)note).Add10TestNotes(); } layoutPanel.SaveLayout(); layoutPanel = new FAKE_LayoutPanel(CoreUtilities.Constants.BLANK, false); //_w.output(String.Format ("{0} Objects Saved", layoutPanel.ObjectsSaved().ToString())); layoutPanel.LoadLayout("testlayout", false, null); // layout = new FakeLayoutDatabase ("testguid"); // // layout.LoadFrom(layoutPanel); // now count RichText notes int count2 = 0; int subnotecount = 0; foreach (NoteDataInterface _note in layoutPanel.GetAllNotes()) { if (_note.GetType() == typeof(NoteDataXML_Panel)) { count2++; subnotecount = subnotecount + ((NoteDataXML_Panel)_note).GetChildNotes().Count; } } // total note count should be (once I get GetNotes working on Child Notes = 60 + 6 + 25 = 91 _w.output(String.Format("{0} Objects Loaded", layoutPanel.GetAllNotes().Count)); //NOT DONE YET Assert.AreEqual(6, count2); Assert.AreEqual(60, subnotecount); Assert.AreEqual(count2, layoutPanel.GetAvailableFolders().Count); // had to change because a linktable makes 91 become 92 Assert.AreEqual(92, layoutPanel.GetAllNotes().Count); }