public void Test_AddNoteText1() { string text = "This is a test"; GDMNoteRecord instance = new GDMNoteRecord(null); instance.AddNoteText(text); StringList value = new StringList(text); Assert.AreEqual(value.Text, instance.Lines.Text); }
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()); } } }
public void Test_AddNoteText2() { string text1 = "This is a test"; string text2 = "This is another test"; GDMNoteRecord instance = new GDMNoteRecord(null); instance.ParseString(text1); instance.AddNoteText(text2); StringList value = new StringList(text1); value.Add(text2); Assert.AreEqual(value.Text, instance.Lines.Text); }