コード例 #1
0
 public BooksController(IBookMock bookMock)
 {
     // if we pass a mock object to the constructor, we are unit testing so no db
     this.db = bookMock;
 }
コード例 #2
0
 public BooksController()
 {
     // if nothing passed to constructor, connect to the db (this is the default)
     this.db = new EFBooks();
 }