mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 19:54:57 +08:00
Adding missing file
--HG-- branch : 1.x
This commit is contained in:
38
src/Orchard.Core.Tests/Common/BbcodeFilterTests.cs
Normal file
38
src/Orchard.Core.Tests/Common/BbcodeFilterTests.cs
Normal file
@@ -0,0 +1,38 @@
|
||||
using NUnit.Framework;
|
||||
using Orchard.Core.Common.Services;
|
||||
|
||||
namespace Orchard.Core.Tests.Common {
|
||||
[TestFixture]
|
||||
public class BbcodeFilterTests {
|
||||
|
||||
private readonly BbcodeFilter _filter = new BbcodeFilter();
|
||||
|
||||
[Test]
|
||||
public void ShouldIgnoreText() {
|
||||
const string text = "foo bar baz";
|
||||
var processed = _filter.ProcessContent(text, null);
|
||||
Assert.That(processed, Is.EqualTo(text));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void ShouldReplaceUrl() {
|
||||
const string text = "foo [url]bar[/url] baz";
|
||||
var processed = _filter.ProcessContent(text, null);
|
||||
Assert.That(processed, Is.EqualTo("foo <a href=\"bar\">bar</a> baz"));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void ShouldReplaceImg() {
|
||||
const string text = "foo [img]bar[/img] baz";
|
||||
var processed = _filter.ProcessContent(text, null);
|
||||
Assert.That(processed, Is.EqualTo("foo <img src=\"bar\">bar</img> baz"));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void ShouldReplaceUrlWithTitle() {
|
||||
const string text = "foo [url=alink]bar[/url] baz";
|
||||
var processed = _filter.ProcessContent(text, null);
|
||||
Assert.That(processed, Is.EqualTo("foo <a href=\"alink\">bar</a> baz"));
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user