コード例 #1
0
 // will be called in background thread
 List <Book> LoadBooksInBackground(string path)
 {
     using (var stream = File.OpenRead(path))
     {
         var books = BookReader.Read(stream);
         return(books);
     }
 }
コード例 #2
0
        public static void Read(string path)
        {
            var files = Directory.GetFiles(path, "*.txt");

            foreach (var filePath in files)
            {
                var book = BookReader.Read(filePath);
                bookStore.Add(book);
            }
        }
コード例 #3
0
ファイル: BookReaderTests.cs プロジェクト: marhoily/Mefisto
 public void Read_Should_Return_Book()
 {
     _bookReader.Read().Should().NotBeNull();
 }