Ejemplo n.º 1
0
        public async Task <IHttpActionResult> GetAll()
        {
            var externalLinks = await _externalLinkService.GetAllAsync(GetUserAndOrganization().OrganizationId);

            var externalLinksViewModel = _mapper.Map <IEnumerable <ExternalLinkDto>, IEnumerable <ExternalLinkViewModel> >(externalLinks);

            return(Ok(externalLinksViewModel));
        }
        public async Task Should_Return_All_External_Link_Depending_On_Organization()
        {
            MockExternalLinks();

            var result = (await _externalLinkService.GetAllAsync(2)).ToList();

            Assert.AreEqual(2, result.Count);
            Assert.AreEqual("Test1", result.First().Name);
        }