Exemplo n.º 1
0
        public void Then_Builds_Child_Links(
            string expectedGetEpaoUrl,
            string expectedGetEpaoCoursesUrl,
            Mock <IUrlHelper> mockUrlHelper,
            GetEpaosApiModel model)
        {
            var expectedLinks = new List <Link>
            {
                new Link
                {
                    Rel  = "self",
                    Href = expectedGetEpaoUrl
                },
                new Link
                {
                    Rel  = "courses",
                    Href = expectedGetEpaoCoursesUrl
                }
            };

            mockUrlHelper.SetupAllEpaoRoutes(null, expectedGetEpaoUrl, expectedGetEpaoCoursesUrl);

            model.BuildLinks(mockUrlHelper.Object);

            foreach (var epao in model.Epaos)
            {
                epao.Links.Should().BeEquivalentTo(expectedLinks);
            }
        }
Exemplo n.º 2
0
        public void Then_Builds_Links(
            string expectedGetEpaosUrl,
            Mock <IUrlHelper> mockUrlHelper,
            GetEpaosApiModel model)
        {
            var expectedLinks = new List <Link>
            {
                new Link
                {
                    Rel  = "self",
                    Href = expectedGetEpaosUrl
                }
            };

            mockUrlHelper.SetupAllEpaoRoutes(expectedGetEpaosUrl, null, null);

            model.BuildLinks(mockUrlHelper.Object);

            model.Links.Should().BeEquivalentTo(expectedLinks);
        }