public async void Task_Update_ValidData_Return_NoContent() { //Arrange var Id = 2; //Act var existingItem = await _controller.GetMenus(Id); if (existingItem == null) { Assert.IsType <NotFoundResult>(Id); } var okResult = existingItem.Should().BeOfType <OkObjectResult>().Subject; var result = okResult.Value.Should().BeAssignableTo <Menus>().Subject; var menus = new Menus() { MenuId = result.MenuId, MenuName = "test", UnitPrice = result.UnitPrice, ThumbPic = result.ThumbPic, LargePic = result.LargePic, Active = "N" }; //_context.Menus.Attach(menus); var updatedData = await _controller.PutMenus(Id, menus); //Assert Assert.IsType <NotFoundResult>(updatedData); }