예제 #1
0
 public void testCut()
 {
     StringTheory theory = new StringTheory("0123456789");
     string str = theory.Cut(4, 4);
     Assert.True(str.Length == 4, "Copied string length is wrong!");
     Assert.True(theory.Length == 6, "Original StringTheory length is wrong!");
     theory.Renew("");
     Assert.True(theory.Cut(0, 1).Equals(""), "bogus Cut didn't return empty.");
     theory.Renew("");
     Assert.True(theory.Cut(0, -1).Equals(""), "bogus Cut (2) didn't return empty.");
 }
예제 #2
0
 public void testCutAndPaste()
 {
     StringTheory theory = new StringTheory("0123456789");
     StringTheory theory2 = new StringTheory();
     string val = theory.Cut(4, 4);
     Assert.True(val.Length == 4, "Copied string length is wrong!");
     Assert.True(theory.Length == 6, "Original StringTheory length is wrong!");
     theory2.Paste(0, val);
     Assert.True(theory2.Length == 4, "Target StringTheory length is wrong!");
 }
예제 #3
0
 public void testTouched()
 {
     StringTheory theory = new StringTheory("mares eat oats");
     theory.Append(theory.Cut(5, 4));
     Assert.True(theory.Touched(), "str doesn't think it was touched.");
     theory = new StringTheory("mares eat oats");
     theory.Upper(7);
     Assert.True(theory.Touched(), "str doesn't think it was touched. 2");
 }