Inheritance: System.Web.UI.WebControls.WebControl, INamingContainer
        public void RichTextEditor_CreateDefaultProvider()
        {
            using (var httpRequest = new HttpSimulator().SimulateRequest())
            {
                //arrange
                var context = new Mock<ISubtextContext>();
                var httpContext = new Mock<HttpContextBase>();
                httpContext.Setup(c => c.Request.ApplicationPath).Returns("path");
                context.Setup(c => c.UrlHelper).Returns(
                    new BlogUrlHelper(new RequestContext(httpContext.Object, new RouteData()), null));
                context.Setup(c => c.Blog).Returns(new Blog { Host = "host" });
                var page = new SubtextPage { SubtextContext = context.Object };
                var editor = new RichTextEditor { Page = page };

                //act
                editor.InitControls(new EventArgs());

                //post
                var provider = editor.Provider;
                Assert.IsTrue(provider is FtbBlogEntryEditorProvider, "FtbBlogEntryEditorProvider is created by default.");
            }
        }
        public void RichTextEditor_CreatePlainText_IfPreferenceSet()
        {
            using (var httpRequest = new HttpSimulator().SimulateRequest())
            {
                //arrange
                var context = new Mock<ISubtextContext>();
                var httpContext = new Mock<HttpContextBase>();
                httpContext.Setup(c => c.Request.ApplicationPath).Returns("path");
                context.Setup(c => c.UrlHelper).Returns(
                    new BlogUrlHelper(new RequestContext(httpContext.Object, new RouteData()), null));
                context.Setup(c => c.Blog).Returns(new Blog { Host = "host" });
                var page = new SubtextPage { SubtextContext = context.Object };
                var editor = new RichTextEditor { Page = page };
                //set use plain text in user preferences
                Preferences.UsePlainHtmlEditor = true;

                //act
                editor.InitControls(new EventArgs());

                //post
                var provider = editor.Provider;
                Assert.IsTrue(provider is PlainTextBlogEntryEditorProvider, "PlainTextBlogEntryEditorProvider is created if it is selected in user preferences.");
            }
        }