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