// will be called in background thread List <Book> LoadBooksInBackground(string path) { using (var stream = File.OpenRead(path)) { var books = BookReader.Read(stream); return(books); } }
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); } }
public void Read_Should_Return_Book() { _bookReader.Read().Should().NotBeNull(); }