Ejemplo n.º 1
0
        public static async void Initialize(TestContext context)
#endif
        {
            resourceContent = await LoadResource.Read("Resources/RenascenceSV.html");

            cache = PageCache.Instance;
        }
Ejemplo n.º 2
0
        public async Task Select_Explicit()
        {
            Uri uri             = new Uri("https://example.com/threads/RenascenceSV.html.100/");
            var resourceContent = await LoadResource.Read("Resources/RenascenceSV.html");

            HtmlDocument doc = new HtmlDocument();

            doc.LoadHtml(resourceContent);
            var forumType = ForumIdentifier.IdentifyForumTypeFromHtmlDocument(doc);

            var adapter = forumAdapterFactory.CreateForumAdapter(forumType, uri);

            Assert.IsInstanceOfType(adapter, typeof(XenForo1Adapter2));
        }
Ejemplo n.º 3
0
        private async Task <string> GetForumResource(ForumType forumType)
        {
            string filename = forumType switch
            {
                ForumType.vBulletin3 => "vBulletin3.html",
                ForumType.vBulletin4 => "vBulletin4.html",
                ForumType.vBulletin5 => "vBulletin5.html",
                ForumType.XenForo1 => "Xenforo1.html",
                ForumType.XenForo2 => "Xenforo2.html",
                ForumType.NodeBB => "NodeBB.html",
                ForumType.phpBB => "phpBB.html",
                _ => string.Empty,
            };

            if (string.IsNullOrEmpty(filename))
            {
                return(string.Empty);
            }

            filename = $"Resources/{filename}";

            return(await LoadResource.Read(filename) ?? "");
        }