コード例 #1
0
 public void testUpper()
 {
     string str = "ABCDEF";
     StringTheory theory = new StringTheory("AbCDeF");
     theory.Upper();
     Assert.True(str.Equals(theory.ToString()), "uppered str doesn't match the comparison string!");
     str = "AbCdEFG";
     theory = new StringTheory("abcdefg");
     theory.Upper(0);
     theory.Upper(2);
     theory.Upper(4);
     theory.Upper(5);
     theory.Upper(6);
     Assert.True(str.Equals(theory.ToString()), "uppered(idx) str doesn't match the comparison string!");
     str = "abCDEfg";
     theory = new StringTheory("abcdefg");
     theory.Upper(2, 3);
     Assert.True(str.Equals(theory.ToString()), "uppered(idx, len) str doesn't match the comparison string!");
 }
コード例 #2
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");
 }