public void TryToAddANullNote()
        {
            // no failure should happen. Simply should not be allowed to to do this.
            FakeLayoutDatabase layout = new FakeLayoutDatabase("testguid");
            NoteDataXML        note   = new NoteDataXML();

            note.Caption = "boo";
            layout.Add(note);
            // we should have one note in the list. Now add null
            layout.Add(null);
            Assert.AreEqual(1, layout.GetNotes().Count);
        }
 public void TryToAddANullNote()
 {
     // no failure should happen. Simply should not be allowed to to do this.
     FakeLayoutDatabase layout = new FakeLayoutDatabase("testguid");
     NoteDataXML note = new NoteDataXML();
     note.Caption = "boo";
     layout.Add(note);
     // we should have one note in the list. Now add null
     layout.Add (null);
     Assert.AreEqual(1, layout.GetNotes().Count);
 }
        public void CountSpecificSubType()
        {
            //-- do unit tests counting store 6 textboxes and know this (countbytype)

            System.Windows.Forms .Form form = new System.Windows.Forms.Form();
            _TestSingleTon.Instance._SetupForLayoutPanelTests();

            int count = 25;
            //	FakeLayoutDatabase layout = new FakeLayoutDatabase ("testguid");
            FAKE_LayoutPanel layoutPanel = new FAKE_LayoutPanel (CoreUtilities.Constants.BLANK, false);
            layoutPanel.NewLayout("testguid", true, null);

            // jan152013 - tweak to allow this to work with new system without rewriting all the tstings in LayoutDatabasetest
            LayoutDatabase layout = layoutPanel.GetLayoutDatabase();

            form.Controls.Add (layoutPanel);
            form.Show ();

            NoteDataXML note = new NoteDataXML ();
            for (int i = 0; i < count; i++) {

                note.Caption = "boo" + i.ToString ();
                layout.Add (note);
                note.CreateParent(layoutPanel);
            }
            _w.output (String.Format ("{0} Notes in Layout before save", layout.GetNotes ().Count.ToString ()));

            for (int i = 0; i < 6; i++) {
                note = new NoteDataXML_RichText ();

                note.Caption = "richText";
                layout.Add (note);
                note.CreateParent(layoutPanel);
            }

            layout.SaveTo();

            //	_w.output(String.Format ("{0} Objects Saved", layout.ObjectsSaved().ToString()));
            layout = new FakeLayoutDatabase ("testguid");

            layout.LoadFrom(layoutPanel);

            // now count RichText notes
            int count2 = 0;
            foreach (NoteDataInterface _note in layout.GetNotes ())
            {
                if (_note.GetType() == typeof(NoteDataXML_RichText))
                    {
                    count2++;
                }

                }

            _w.output(String.Format ("{0} Objects Loaded", layout.GetNotes().Count));

            // added linktable
            Assert.AreEqual (7, count2);
        }
        public void CountSpecificSubType()
        {
            //-- do unit tests counting store 6 textboxes and know this (countbytype)

            System.Windows.Forms.Form form = new System.Windows.Forms.Form();
            _TestSingleTon.Instance._SetupForLayoutPanelTests();


            int count = 25;
            //	FakeLayoutDatabase layout = new FakeLayoutDatabase ("testguid");
            FAKE_LayoutPanel layoutPanel = new FAKE_LayoutPanel(CoreUtilities.Constants.BLANK, false);

            layoutPanel.NewLayout("testguid", true, null);

            // jan152013 - tweak to allow this to work with new system without rewriting all the tstings in LayoutDatabasetest
            LayoutDatabase layout = layoutPanel.GetLayoutDatabase();

            form.Controls.Add(layoutPanel);
            form.Show();

            NoteDataXML note = new NoteDataXML();

            for (int i = 0; i < count; i++)
            {
                note.Caption = "boo" + i.ToString();
                layout.Add(note);
                note.CreateParent(layoutPanel);
            }
            _w.output(String.Format("{0} Notes in Layout before save", layout.GetNotes().Count.ToString()));

            for (int i = 0; i < 6; i++)
            {
                note = new NoteDataXML_RichText();

                note.Caption = "richText";
                layout.Add(note);
                note.CreateParent(layoutPanel);
            }

            layout.SaveTo();

            //	_w.output(String.Format ("{0} Objects Saved", layout.ObjectsSaved().ToString()));
            layout = new FakeLayoutDatabase("testguid");

            layout.LoadFrom(layoutPanel);

            // now count RichText notes
            int count2 = 0;

            foreach (NoteDataInterface _note in layout.GetNotes())
            {
                if (_note.GetType() == typeof(NoteDataXML_RichText))
                {
                    count2++;
                }
            }

            _w.output(String.Format("{0} Objects Loaded", layout.GetNotes().Count));


            // added linktable
            Assert.AreEqual(7, count2);
        }