예제 #1
0
        public void GetMyLinksTest()
        {
            int    id       = 29;
            MyLink testLink = new MyLink
            {
                MyLinkId = 29
            };
            List <MyLink> myTestLinks = new List <MyLink>();

            myTestLinks.Add(testLink);
            _mockMyLinksRepository.Setup(x => x.GetMyLinks()).Returns(myTestLinks);

            var myLinks = _sut.GetMyLinks().ToList <MyLink>();

            Assert.Single(myLinks);
        }
예제 #2
0
        public ActionResult <IEnumerable <MyLinkReadDTO> > Get()
        {
            var myLinks = _myLinksService.GetMyLinks();

            return(Ok(_mapper.Map <IEnumerable <MyLinkReadDTO> >(myLinks)));
        }