コード例 #1
0
        public ActionResult Create(BookViewMoel model)
        {
            this._bookService.Add(model);

            ViewBag.Message = "新增成功";
            return(View(model));
        }
コード例 #2
0
        public void CreateTest_should_invoke_IBookService_Add_one_time()
        {
            var bookController = new BookController(bookServiceStub);

            var book = new BookViewMoel()
            {
                ISBN = "9789869094481", Name = "玩出好創意"
            };
            var result = bookController.Create(book);

            bookServiceStub.Received().Add(Arg.Is <BookViewMoel>
                                               (x => x.ISBN == book.ISBN && x.Name == book.Name));
        }
コード例 #3
0
 public void Create(BookViewMoel book)
 {
     I.Enter(book.ISBN).In("#isbn")
     .Enter(book.Name).In("#name")
     .Click("input[type=\"submit\"]");
 }