示例#1
0
        public void TestFixMixedContentReferences_ProtocolRelativeReference(string input)
        {
            var editor = new HatenaBlogContentEditor(input);

            editor.FixMixedContentReferences();

            Assert.AreEqual(input, editor.ToString(), "modified content");
        }
示例#2
0
        public void TestFixMixedContentReferences_HttpsReference(string input, string expectedResult)
        {
            var editor = new HatenaBlogContentEditor(input);

            editor.FixMixedContentReferences();

            Assert.AreEqual(expectedResult, editor.ToString(), "modified content");
        }
示例#3
0
        public void TestReplaceBlogUrlToHttps_NonBlogUrl(string input)
        {
            var editor = new HatenaBlogContentEditor(input);

            editor.ReplaceBlogUrlToHttps(new[] { "example.com" });

            Assert.AreEqual(input, editor.ToString(), "modified content");
        }
示例#4
0
        public void TestReplaceBlogUrlToHttps(string input, string expectedResult)
        {
            var editor = new HatenaBlogContentEditor(input);

            editor.ReplaceBlogUrlToHttps(new[] { "example.com", "example.net" });

            Assert.AreEqual(expectedResult, editor.ToString(), "modified content");
        }
示例#5
0
        public void TestFixMixedContentReferences_WithPredicate(string input, string expectedResult)
        {
            var editor = new HatenaBlogContentEditor(input);

            editor.FixMixedContentReferences(attribute => attribute.Value.Contains("//example.com/"));

            Assert.AreEqual(expectedResult, editor.ToString(), "modified content");
        }
示例#6
0
        public void TestFixMixedContentReferences_NonEmbeddedReferences(string input)
        {
            var editor = new HatenaBlogContentEditor(input);

            editor.FixMixedContentReferences();

            Assert.AreEqual(input, editor.ToString(), "modified content");
        }