EnableRSS() public method

Checks if the current blog has RSS enabled
public EnableRSS ( ) : bool
return bool
Exemplo n.º 1
0
        public void EnableRSS(bool enabled)
        {
            var blogTemplateId = ID.NewID;

            var settings = Mock.Of<IWeBlogSettings>(x =>
                x.ContentRootPath == "/sitecore/content" &&
                x.BlogTemplateIds == new[] { ID.NewID, blogTemplateId, ID.NewID }
            );

            var manager = new BlogManager(settings);

            using (var db = new Db
            {
                new DbItem("blog", ID.NewID, blogTemplateId)
                {
                    { "Enable RSS", enabled ? "1" : string.Empty }
                }
            })
            {
                var item = db.GetItem("/sitecore/content/blog");
                var result = manager.EnableRSS(item);

                if(enabled)
                    Assert.That(result, Is.True);
                else
                {
                    Assert.That(result, Is.False);
                }
            }
        }
Exemplo n.º 2
0
        public void EnableRSS_NullBlog()
        {
            var blogTemplateId = ID.NewID;

            var settings = Mock.Of<IWeBlogSettings>(x =>
                x.ContentRootPath == "/sitecore/content" &&
                x.BlogTemplateIds == new[] { ID.NewID, blogTemplateId, ID.NewID }
            );

            var manager = new BlogManager(settings);
            var result = manager.EnableRSS(null);

            Assert.That(result, Is.False);
        }