mirror of
https://github.com/jcreek/Creek.HelpfulExtensions.git
synced 2026-07-12 18:53:45 +00:00
feat(*): Add StringExtensionTests
This commit is contained in:
@@ -0,0 +1,29 @@
|
|||||||
|
using NUnit.Framework;
|
||||||
|
using Creek.HelpfulExtensions;
|
||||||
|
|
||||||
|
namespace UnitTests
|
||||||
|
{
|
||||||
|
public class StringExtensionTests
|
||||||
|
{
|
||||||
|
[SetUp]
|
||||||
|
public void Setup()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void IsSubstringBetweenFirst()
|
||||||
|
{
|
||||||
|
string s = "bigfishmandogcatdoghat";
|
||||||
|
s = s.SubstringBetween("fish", "dog");
|
||||||
|
Assert.AreEqual("fishman", s);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void IsSubstringBetweenLast()
|
||||||
|
{
|
||||||
|
string s = "bigfishmandogcatdoghat";
|
||||||
|
s = s.SubstringBetween("fish", "dog", true);
|
||||||
|
Assert.AreEqual("fishmandogcat", s);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user