public async void Task_Add_Category_Return_OkResult() { //Arrange var controller = new BookCategoryController(context); var bk = new BookCategory() { BookCategoryName = "English", BookCategoryDescription = "English Desc", BookCategoryImage = "img333" }; //Act var data = await controller.Post(bk); //Assert Assert.IsType <CreatedAtActionResult>(data); }
public async void Task_Add_BookCategory_Return_BadRequest() { //Arrange var controller = new BookCategoryController(context); var bookCategory = new BookCategory() { BookCategoryName = "AutoBiography", BookCategoryDescription = "An account of a person's life written by that person.", BookCategoryImage = "https://images-na.ssl-images-amazon.com/images/I/51ZNnb4qOtL._SX425_.jpg" }; //Act var data = await controller.Post(bookCategory); //Assert Assert.IsType <BadRequestResult>(data); }
public async void Task_Add_Category_Return_BadRequest() { //Arrange var controller = new BookCategoryController(context); var bk = new BookCategory() { BookCategoryName = "MathsMathsMathsMathsMathsMaths", BookCategoryDescription = "Maths Desc", BookCategoryImage = "pic123" }; //Act var data = await controller.Post(bk); //Assert Assert.IsType <BadRequestResult>(data); }
public async void Task_Add_BookCategory_Return_OkResult() { //Arrange var controller = new BookCategoryController(context); 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 = "123" BookCategoryName = "Autobiography", BookCategoryDescription = "An account of a person's life written by that person.", BookCategoryImage = "https://images-na.ssl-images-amazon.com/images/I/51ZNnb4qOtL._SX425_.jpg" }; //Act var data = await controller.Post(bookCategory); //Assert Assert.IsType <CreatedAtActionResult>(data); }