static IEnumerable <Note> Read(IFileSystemInfo info)
 {
     if (string.Equals(".md", info.Extension, StringComparison.InvariantCultureIgnoreCase))
     {
         return(MarkdownNotesReader.Read(info.FullName));
     }
     else if (string.Equals(".txt", info.Extension, StringComparison.InvariantCultureIgnoreCase))
     {
         return(NotesReader.Read(info.FullName));
     }
     return(Enumerable.Empty <Note>());
 }
예제 #2
0
        public void ReadTest()
        {
            // arrange
            var markdownFile = this.TestFile("notes.md");

            // act
            var notes = MarkdownNotesReader.Read(markdownFile).ToArray();

            // assert
            Assert.AreEqual(3, notes.Length);
            var n = notes[2];

            Assert.AreEqual("#snippet #Person #Donald Duck Birthday", n.Name);
            Assert.AreEqual("1.1.2000", n.Content);
        }