示例#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
 public void Read_Should_Return_Book()
 {
     _bookReader.Read().Should().NotBeNull();
 }