예제 #1
0
        public void Test_Common()
        {
            using (GDMNoteRecord noteRec = new GDMNoteRecord(null)) {
                Assert.AreEqual(GDMRecordType.rtNote, noteRec.RecordType);

                noteRec.AddNoteText("text");
                Assert.AreEqual("text", noteRec.Lines.Text.Trim());

                Assert.Throws(typeof(ArgumentNullException), () => {
                    noteRec.SetNoteText(null);
                });

                noteRec.SetNoteText("Test text");
                Assert.AreEqual("Test text", noteRec.Lines.Text.Trim());

                using (GDMNoteRecord noteRec2 = new GDMNoteRecord(null)) {
                    noteRec2.SetNoteText("Test text");
                    Assert.AreEqual("Test text", noteRec2.Lines.Text.Trim());

                    Assert.AreEqual(100.0f, noteRec.IsMatch(noteRec2, new MatchParams()), 0.01f);

                    Assert.IsFalse(noteRec2.IsEmpty());
                    noteRec2.Clear();
                    Assert.IsTrue(noteRec2.IsEmpty());

                    Assert.AreEqual(0.0f, noteRec.IsMatch(noteRec2, new MatchParams()), 0.01f);

                    Assert.AreEqual(0.0f, noteRec.IsMatch(null, new MatchParams()), 0.01f);
                }

                Assert.Throws(typeof(ArgumentException), () => {
                    noteRec.MoveTo(null);
                });

                Assert.Throws(typeof(ArgumentException), () => {
                    noteRec.Assign(null);
                });

                using (GDMNoteRecord noteRec3 = new GDMNoteRecord(null)) {
                    noteRec3.SetNoteText("Test text 3");
                    Assert.AreEqual("Test text 3", noteRec3.Lines.Text.Trim());

                    noteRec.MoveTo(noteRec3);

                    Assert.AreEqual("Test text 3", noteRec3.Lines.Text.Trim());
                }
            }
        }
예제 #2
0
        public void Test_SetNoteText3()
        {
            GDMNoteRecord instance = new GDMNoteRecord(null);

            Assert.Throws(typeof(ArgumentNullException), () => {
                instance.SetNoteText(null);
            });
        }
예제 #3
0
        public void Test_SetNoteText1()
        {
            string        text     = "Yet another test";
            GDMNoteRecord instance = new GDMNoteRecord(null);

            instance.SetNoteText(text);

            StringList value = new StringList(text);

            Assert.AreEqual(value.Text, instance.Lines.Text);
        }