當前位置: 首頁>>代碼示例>>C#>>正文


C# DatabaseObjectProvider.GetBlogByDomainAlias方法代碼示例

本文整理匯總了C#中Subtext.Framework.Data.DatabaseObjectProvider.GetBlogByDomainAlias方法的典型用法代碼示例。如果您正苦於以下問題:C# DatabaseObjectProvider.GetBlogByDomainAlias方法的具體用法?C# DatabaseObjectProvider.GetBlogByDomainAlias怎麽用?C# DatabaseObjectProvider.GetBlogByDomainAlias使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Subtext.Framework.Data.DatabaseObjectProvider的用法示例。


在下文中一共展示了DatabaseObjectProvider.GetBlogByDomainAlias方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: CheckBlogNotReturnedWithoutAlias

        public void CheckBlogNotReturnedWithoutAlias()
        {
            UnitTestHelper.CreateBlogAndSetupContext();
            var repository = new DatabaseObjectProvider();
            Blog testBlog = repository.GetBlogByDomainAlias(UnitTestHelper.GenerateUniqueString(),
                                                                           UnitTestHelper.GenerateUniqueString(), false);

            Assert.IsNull(testBlog);
        }
開發者ID:rhoadsce,項目名稱:Subtext,代碼行數:9,代碼來源:BlogAliasTests.cs

示例2: CheckThatAliasChecksSubfolderIfBlogOnSameHost

        public void CheckThatAliasChecksSubfolderIfBlogOnSameHost()
        {
            var repository = new DatabaseObjectProvider();
            Blog blog = UnitTestHelper.CreateBlogAndSetupContext();
            BlogAlias alias = UnitTestHelper.CreateBlogAlias(blog, blog.Host, UnitTestHelper.GenerateUniqueString());

            repository.AddBlogAlias(alias);

            Blog testBlog = repository.GetBlogByDomainAlias(blog.Host, "", false);
            Assert.IsNull(testBlog, "Should not have found a blog, alias is on same host.");
        }
開發者ID:rhoadsce,項目名稱:Subtext,代碼行數:11,代碼來源:BlogAliasTests.cs

示例3: CheckBlogNotReturnedWithInactiveAlias

        public void CheckBlogNotReturnedWithInactiveAlias()
        {
            var repository = new DatabaseObjectProvider();
            Blog blog = UnitTestHelper.CreateBlogAndSetupContext();
            BlogAlias alias = UnitTestHelper.CreateBlogAlias(blog, UnitTestHelper.GenerateUniqueString(), "", false);

            BlogAlias testAlias = repository.GetBlogAlias(alias.Id);
            Blog testBlog = repository.GetBlogByDomainAlias(alias.Host, alias.Subfolder, false);

            Assert.AreNotEqual(NullValue.NullInt32, alias.Id, "Alias was not saved.");
            Assert.AreEqual(alias.Id, testAlias.Id, "The test alias is not the alias saved.");
            Assert.IsFalse(testAlias.IsActive, "This alias is active.");
            Assert.IsNull(testBlog, "Should not have found a blog");
        }
開發者ID:rhoadsce,項目名稱:Subtext,代碼行數:14,代碼來源:BlogAliasTests.cs

示例4: GetBlogByAliasWithSubfolders

        public void GetBlogByAliasWithSubfolders()
        {
            var repository = new DatabaseObjectProvider();
            Blog blog1 = UnitTestHelper.CreateBlogAndSetupContext();
            Blog blog2 = UnitTestHelper.CreateBlogAndSetupContext();
            string host = UnitTestHelper.GenerateUniqueString();
            BlogAlias alias1 = UnitTestHelper.CreateBlogAlias(blog1, host, UnitTestHelper.GenerateUniqueString());
            BlogAlias alias2 = UnitTestHelper.CreateBlogAlias(blog2, host, UnitTestHelper.GenerateUniqueString());

            repository.AddBlogAlias(alias1);
            repository.AddBlogAlias(alias2);

            Blog testBlog1 = repository.GetBlogByDomainAlias(alias1.Host, alias1.Subfolder, false);
            Blog testBlog2 = repository.GetBlogByDomainAlias(alias2.Host, alias2.Subfolder, false);

            Assert.AreEqual(blog1.Id, testBlog1.Id, "Found the wrong blog.");
            Assert.AreEqual(blog2.Id, testBlog2.Id, "Found the wrong blog.");
        }
開發者ID:rhoadsce,項目名稱:Subtext,代碼行數:18,代碼來源:BlogAliasTests.cs

示例5: GetBlogByAliasNoSubfolder

        public void GetBlogByAliasNoSubfolder()
        {
            var repository = new DatabaseObjectProvider();
            Blog blog = UnitTestHelper.CreateBlogAndSetupContext();
            BlogAlias alias = UnitTestHelper.CreateBlogAlias(blog, UnitTestHelper.GenerateUniqueString(), "");

            repository.AddBlogAlias(alias);
            Blog testBlog = repository.GetBlogByDomainAlias(alias.Host, alias.Subfolder, false);
            Assert.AreEqual(blog.Id, testBlog.Id, "Found the wrong blog.");
        }
開發者ID:rhoadsce,項目名稱:Subtext,代碼行數:10,代碼來源:BlogAliasTests.cs


注:本文中的Subtext.Framework.Data.DatabaseObjectProvider.GetBlogByDomainAlias方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。