public async Task SearchTest() { var bookType = new BookType { ID = default(Guid), Discription = "Discription 1" }; var fakeRepositoryMock = new Mock <IBookTypeRepository>(); fakeRepositoryMock.Setup(x => x.Find(It.IsAny <Guid>())).Returns(bookType); var service = new BookTypeService(fakeRepositoryMock.Object); var result = service.Get(default(Guid)); Assert.Equal("Discription 1", result.Discription); }
// GET: BookType/Edit/5 public ActionResult Edit(Guid id) { BookType bookType = _bookTypeService.Get(id); return(View(bookType)); }