From 851d587d1f0b9523f41969f5221dff70a03aecce Mon Sep 17 00:00:00 2001 From: Robert Date: Wed, 6 Sep 2017 11:28:44 +0200 Subject: [PATCH] Added Html Strip tests --- .../FrontEnd/UmbracoHelperTests.cs | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/src/Umbraco.Tests/FrontEnd/UmbracoHelperTests.cs b/src/Umbraco.Tests/FrontEnd/UmbracoHelperTests.cs index d886009e00..a3de9c2435 100644 --- a/src/Umbraco.Tests/FrontEnd/UmbracoHelperTests.cs +++ b/src/Umbraco.Tests/FrontEnd/UmbracoHelperTests.cs @@ -129,5 +129,31 @@ namespace Umbraco.Tests.FrontEnd Assert.AreEqual("Hello world, this is some text with…", result); } + + [Test] + public void Strip_All_Html() + { + var text = "Hello world, this is some text with a link"; + + var helper = new UmbracoHelper(); + + var result = helper.StripHtml(text, null).ToString(); + + Assert.AreEqual("Hello world, this is some text with a link", result); + } + + [Test] + public void Strip_Specific_Html() + { + var text = "Hello world, this is some text with a link"; + + string [] tags = {"b"}; + + var helper = new UmbracoHelper(); + + var result = helper.StripHtml(text, tags).ToString(); + + Assert.AreEqual("Hello world, this is some text with a link", result); + } } }