public async Task TestPutFactorySuccess() { //Should update Factory FactoryDTO dto = new FactoryDTO(); dto.Description = "Test_Factory_Updated"; dto.FactoryId = 1; var result = await controller.PutFactory(1, dto); Assert.IsType <OkObjectResult>(result); OkObjectResult new_res = (OkObjectResult)await controller.GetFactory(1); FactoryDTO new_dto = (FactoryDTO)new_res.Value; //Information inside the retrived FactoryDTO should be updated Assert.Equal("Test_Factory_Updated", new_dto.Description); Assert.True(1 == new_dto.FactoryId); }