Exemple #1
0
        public void ReadTomboyfileTest()
        {
            ImportNotes  importnotes = new ImportNotes(this.notes);
            StreamReader reader      = new StreamReader(testnote1, true);

            TextBox     tbtitle    = new TextBox();
            RichTextBox rtbNewNote = new RichTextBox();

            string exceptedrtf = @"{\rtf1\ansi\ansicpg1252\deff0\deflang" + Properties.Settings.Default.rtflangused + @"{\fonttbl{\f0\fnil\fcharset0 Microsoft Sans Serif;}}
\viewkind4\uc1\pard\f0\fs17 test note1\par
\par
This is a \b test\b0  tomboy \strike file\strike0  \i note\i0 .\par
}
";

            importnotes.ReadTomboyfile(reader, testnote1, tbtitle, rtbNewNote);

            Assert.AreEqual(exceptedrtf, rtbNewNote.Rtf);
        }
Exemple #2
0
        public void ReadCSVfileTest()
        {
            ImportNotes importnotes = new ImportNotes(this.notes);

            while (this.notes.CountNotes > 0)
            {
                this.notes.RemoveNote(0);
            }

            importnotes.ReadStickiesCSVFile(testcsvfile);
            Assert.AreEqual(2, this.notes.CountNotes, "Not excepted number of notes imported.");

            string exceptedrtfnote1 = "{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang" + Properties.Settings.Default.rtflangused + "{\\fonttbl{\\f0\\fnil\\fcharset0 Verdana;}}\r\n{\\colortbl ;\\red0\\green0\\blue0;}\r\n{\\*\\generator Msftedit 5.41.21.2510;}\\viewkind4\\uc1\\pard\\qr\\cf1\\f0\\fs20 test1\\par\r\n}\r\n";
            string currentrtfnote1  = this.notes.GetNote(0).GetContent();

            Assert.AreEqual(currentrtfnote1, exceptedrtfnote1, "RTF import went wrong.");

            string exceptedrtfnote2 = "{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang" + Properties.Settings.Default.rtflangused + "{\\fonttbl{\\f0\\fnil Verdana;}{\\f1\\fnil\\fcharset0 Verdana;}}\r\n{\\colortbl ;\\red0\\green0\\blue0;}\r\n{\\*\\generator Msftedit 5.41.21.2510;}\\viewkind4\\uc1\\pard\\cf1\\f0\\fs20  \\f1 test\\b test\\b0 test2\\par\r\n}\r\n"; // \\f0
            string currentrtfnote2  = this.notes.GetNote(1).GetContent();

            Assert.AreEqual(currentrtfnote2, exceptedrtfnote2, "RTF import note 2 went wrong.");
        }