public async Task <bool> Testfor_Validate_UpdateCategory() { //Arrange bool res = false; var _categoryUpdate = new Category() { Id = "5f0ff60a7b7be11c4c3c19e1", CatId = 1, Url = "~/Home", OpenInNewWindow = false }; //Act adminservice.Setup(repo => repo.UpdateCategory(_categoryUpdate.Id, _categoryUpdate)).ReturnsAsync(_categoryUpdate); var result = await _adminGroceryS.UpdateCategory(_categoryUpdate.Id, _categoryUpdate); if (result == _categoryUpdate) { res = true; } //Asert //final result displaying in text file await File.AppendAllTextAsync("../../../../output_revised.txt", "Testfor_Validate_UpdateCategory=" + res + "\n"); return(res); }
public async Task <IActionResult> Updatecategory(string Id, [FromBody] Category category) { //Do code here if (Id is null) { return(NotFound("Category with Id not found")); } Task <Category> up_cat = _adminGS.UpdateCategory(Id, category); if (up_cat.Result is null) { return(Ok("Make Sure Id and Category is correct")); } return(Ok("Updated")); }