public async Task TestDeleteFactorySuccess() { //Should remove the factory var result = await controller.DeleteFactory(2); Assert.IsType <OkObjectResult>(result); OkObjectResult new_res = (OkObjectResult)result; FactoryDTO new_dto = (FactoryDTO)new_res.Value; //Information inside the elimanated FactoryDTO should be equivalent to the requested factory for deletion Assert.Equal("Second_Test_Factory", new_dto.Description); Assert.True(2 == new_dto.FactoryId); //Should not be possible to get the factory once its deleted var result2 = await controller.GetFactory(2); Assert.IsType <NotFoundResult>(result2); }