Example #1
0
 public void TestEmptyText()
 {
     Assert.AreEqual(-1, StringHelpers.IndexOf("", "bb", 0, 0));
     Assert.AreEqual(0, StringHelpers.IndexOf("", "", 0, 0));
     Assert.AreEqual(0, "".IndexOf("", 0, 0));
 }
Example #2
0
 public void TestValuePartiallyExists()
 {
     Assert.AreEqual(-1,
                     StringHelpers.IndexOf("aabbcc", "ccaa", 0, 6));
 }
Example #3
0
 public void TestEmptyValue()
 {
     Assert.AreEqual(2, StringHelpers.IndexOf("aabbcc", "", 2, 4));
 }
Example #4
0
 public void TestEnding()
 {
     Assert.AreEqual(4, StringHelpers.IndexOf("aabbcc", "cc", 0, 6));
 }
Example #5
0
 public void TestInvalidValueLength()
 {
     Assert.AreEqual(-1,
                     StringHelpers.IndexOf("aabbcc", "xxxxxxx", 0, 6));
 }
Example #6
0
 public void TestEmptyText()
 {
     Assert.AreEqual(false, StringHelpers.Compare("", "bb", 0));
     Assert.AreEqual(true, StringHelpers.Compare("", "", 0));
 }
Example #7
0
 public void TestBeginning()
 {
     Assert.AreEqual(0, StringHelpers.IndexOf("aabbcc", "aa", 0, 6));
 }
Example #8
0
 public void TestNullText()
 {
     Assert.Throws <ArgumentNullException>(
         () => StringHelpers.IndexOf(null, "bb", 2, 3));
 }
Example #9
0
 public void TestOutOfCountRange()
 {
     Assert.AreEqual(-1, StringHelpers.IndexOf("aab", "ab", 0, 2));
 }
Example #10
0
 public void TestSimple()
 {
     Assert.AreEqual(true, StringHelpers.Compare("aabbcc", "bb", 2));
     Assert.AreEqual(false, StringHelpers.Compare("aabbcc", "bb", 3));
 }
Example #11
0
 public void TestNullValue()
 {
     Assert.Throws <ArgumentNullException>(
         () => StringHelpers.IndexOf("aabbcc", null, 2, 3));
 }
Example #12
0
 public void TestNullText()
 {
     Assert.Throws <ArgumentNullException>(
         () => StringHelpers.Compare(null, "bb", 2));
 }
Example #13
0
 public void TestNullValue()
 {
     Assert.Throws <ArgumentNullException>(
         () => StringHelpers.Compare("aabbcc", null, 2));
 }
Example #14
0
 public void TestInvalidStartIndex()
 {
     Assert.Throws <ArgumentOutOfRangeException>(
         () => StringHelpers.Compare("aabbcc", "bbc", 4));
 }
Example #15
0
 public void TestSimple()
 {
     Assert.AreEqual(2, StringHelpers.IndexOf("aabbcc", "bb", 0, 6));
 }
Example #16
0
 public void TestNegative()
 {
     Assert.AreEqual(-1, StringHelpers.IndexOf("aabbcc", "xx", 0, 6));
 }
Example #17
0
 public void TestInvalidCount()
 {
     Assert.Throws <ArgumentOutOfRangeException>(
         () => StringHelpers.IndexOf("aabbcc", "bb", 2, 5));
 }
Example #18
0
 public void TestEmptyValue()
 {
     Assert.AreEqual(true, StringHelpers.Compare("aabbcc", "", 2));
 }