public void Given_CatalogueId_As_string_1() { string catalogueId = "1"; CatalogueByGuidModel catalogueByGuidModel = new CatalogueByGuidModel(); var taskDecorator = Task.FromResult(catalogueByGuidModel); _mockRetrieveCatalogueDetailsRepo.Setup(x => x.GetCatalogueByGuid(It.IsAny <string>())).Returns(taskDecorator); var result = _catalogueDetails.GetCatalogueByCatalogueId(catalogueId); Assert.IsTrue(result is Task <CatalogueByGuidModel>); }
public async Task <IActionResult> GetCompanyDetails([FromRoute] string catalogueId) { try { CatalogueByGuidModel catalogueDetails = await _catalogueDetails.GetCatalogueByCatalogueId(catalogueId); if (catalogueDetails != null) { return(Ok(catalogueDetails)); } else { return(StatusCode(404)); } } catch (Exception e) { return(StatusCode(500, e.Message)); } }