public async void Task_Update_Category_Return_OkResult() { //Arrange var controller = new BookCategoryController(context); var BookCategoryId = 11; //Assert var editBookCategory = new BookCategory() { BookCategoryId = 11, BookCategoryName = "Baba", BookCategoryDescription = "Baba Desc", BookCategoryImage = "img123" }; var updateData = await controller.Put(BookCategoryId, editBookCategory); Assert.IsType <OkObjectResult>(updateData); }
public async void Task_Update_BookCategory_Return_BadRequest() { //Arrange var controller = new BookCategoryController(context); int?id = null; var bookCategory = new BookCategory() { BookCategoryName = "Mystery", BookCategoryDescription = "Mystery fiction is a genre of fiction usually involving a mysterious death or a crime to be solved. Often with a closed circle of suspects, each suspect is usually provided with a credible motive and a reasonable opportunity for committing the crime.", BookCategoryImage = "https://cdn2.bigcommerce.com/server1500/ac84d/products/1019/images/2196/Mystery_-_Logo_%2526_Name_Logo__35697.1326392559.380.380.jpg?c=2" }; //Act var data = await controller.Put(id, bookCategory); //Assert Assert.IsType <BadRequestResult>(data); }
public async void Task_Update_Category_Return_NotFound() { //Arrange var controller = new BookCategoryController(context); var BookCategoryId = 10; var bk = new BookCategory() { BookCategoryId = 1, BookCategoryName = "Delhi Publisher", BookCategoryDescription = "New Delhi Publishers is an International repute publisher with an orientation towards research, practical and Technical Applications.", BookCategoryImage = "123" }; //Act var data = await controller.Put(BookCategoryId, bk); //Assert Assert.IsType <NotFoundResult>(data); }