Пример #1
0
        public void ParseAsResource_Simplest_Test()
        {
            AwesomeBlazorParser.TryParseAsResource(
                "* [Fizz Buzz](https://github.com/fizz/buzz) - " +
                "This is fizz buzz. ",
                out var resource
                ).IsTrue();

            resource.Title.Is("Fizz Buzz");
            resource.ResourceUrl.Is("https://github.com/fizz/buzz");
            resource.GitHubStarsUrl.Is("");
            resource.LastCommitUrl.Is("");
            resource.DescriptionText.Is("This is fizz buzz.");
        }
Пример #2
0
        public void ParseAsResource_FullSet_Test()
        {
            AwesomeBlazorParser.TryParseAsResource(
                "* [Foo Bar](https://github.com/foo/bar) - " +
                "![GitHub stars](https://img.shields.io/github/stars/foo/bar?style=flat-square&cacheSeconds=604800&logo=foo) " +
                "![last commit](https://img.shields.io/github/last-commit/foo/bar?style=flat-square&cacheSeconds=86400) " +
                "![custom badge](https://img.shields.io/foo) This is `foo` and <bar>. " +
                "[Demo](https://foo.bar.example.com) and [[Video]](https://youtube.com/).",
                out var resource
                ).IsTrue();

            resource.Title.Is("Foo Bar");
            resource.ResourceUrl.Is("https://github.com/foo/bar");
            resource.GitHubStarsUrl.Is("https://img.shields.io/github/stars/foo/bar?style=flat-square&cacheSeconds=604800&logo=foo");
            resource.LastCommitUrl.Is("https://img.shields.io/github/last-commit/foo/bar?style=flat-square&cacheSeconds=86400");
            resource.DescriptionText.Is("This is foo and . Demo and [Video].");
            resource.DescriptionHtml.Is(
                "<img src=\"https://img.shields.io/foo\" alt=\"custom badge\" /> " +
                "This is <code>foo</code> and <bar>. " +
                "<a href=\"https://foo.bar.example.com\" target=\"_blank\">Demo</a> and " +
                "<a href=\"https://youtube.com/\" target=\"_blank\">[Video]</a>.");
        }