Пример #1
0
        public void GetCategoryRelativeLink_returns_url_starts_with_slash()
        {
            var slug         = "technology";
            var relativeLink = BlogRoutes.GetCategoryRelativeLink(slug);

            Assert.Equal("/posts/categorized/technology", relativeLink);
        }
        public async void GetCategoriesAsync_Test()
        {
            // Arrange
            SeedTestPosts(11);

            // Act
            var metaCatList = await _svc.GetCategoriesAsync(BLOG_ID, USERNAME, PASSWORD, ROOT_URL);

            var catUrl = BlogRoutes.GetCategoryRelativeLink(CAT_SLUG);

            // Assert
            Assert.Single(metaCatList);
            Assert.Equal($"{ROOT_URL}{catUrl}", metaCatList[0].HtmlUrl);
        }
Пример #3
0
        public async Task <string> GetNavUrlAsync(int id)
        {
            var cat = await GetAsync(id);

            return(BlogRoutes.GetCategoryRelativeLink(cat.Slug));
        }