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