Piscal Client improvements

This commit is contained in:
2016-02-14 23:12:31 -05:00
parent be89837a27
commit 5057d9b577
10 changed files with 143 additions and 22 deletions
@@ -0,0 +1,42 @@
using System;
using LeafWeb.Core.Utility;
using NUnit.Framework;
namespace LeafWeb.Core.Tests.Utility
{
[TestFixture]
public class StringExtensionsTests
{
[Test]
public void FilterAlphaNumeric_AllGood()
{
var str = "thisIsFine123_";
var result = str.FilterAlphaNumeric();
Assert.That(result, Is.EqualTo(str));
}
[Test]
public void FilterAlphaNumeric_NotAllowed()
{
var str = "notAllowed%";
var result = str.FilterAlphaNumeric();
Assert.That(result, Is.EqualTo("notAllowed"));
}
[Test]
public void FilterAlphaNumeric_Space()
{
var str = "s p a c e s";
var result = str.FilterAlphaNumeric();
Assert.That(result, Is.EqualTo("spaces"));
}
[Test]
public void FilterAlphaNumeric_NewLine()
{
var str = "new" + Environment.NewLine + "line";
var result = str.FilterAlphaNumeric();
Assert.That(result, Is.EqualTo("newline"));
}
}
}