public void 한글스트링_지우기테스트() { SHangulString pHangul = new SHangulString("쀍 Hi"); pHangul.DoRemove(); Assert.AreEqual("쀍 H", pHangul.ToString()); pHangul.DoRemove(); Assert.AreEqual("쀍 ", pHangul.ToString()); pHangul.DoRemove(); Assert.AreEqual("쀍", pHangul.ToString()); pHangul.DoRemove(); Assert.AreEqual("쀌", pHangul.ToString()); pHangul.DoRemove(); Assert.AreEqual("쀄", pHangul.ToString()); pHangul.DoRemove(); Assert.AreEqual("뿌", pHangul.ToString()); pHangul.DoRemove(); Assert.AreEqual("ㅃ", pHangul.ToString()); pHangul.DoRemove(); Assert.AreEqual("", pHangul.ToString()); }
public void 한글스트링_작성하기테스트_이상한경우() { SHangulString pHangul = new SHangulString(); pHangul.DoInsert('ㄱ').DoInsert('ㄴ').DoInsert('ㄷ'). DoInsert('ㅏ').DoInsert('ㅑ'). DoInsert('ㅗ').DoInsert('ㅐ'); Assert.AreEqual("ㄱㄴ다ㅑㅙ", pHangul.ToString()); pHangul.DoRemove(); Assert.AreEqual("ㄱㄴ다ㅑㅗ", pHangul.ToString()); pHangul.DoRemove(); Assert.AreEqual("ㄱㄴ다ㅑ", pHangul.ToString()); pHangul.DoRemove(); Assert.AreEqual("ㄱㄴ다", pHangul.ToString()); pHangul.DoRemove(); Assert.AreEqual("ㄱㄴㄷ", pHangul.ToString()); pHangul.DoRemove(); Assert.AreEqual("ㄱㄴ", pHangul.ToString()); pHangul.DoRemove(); Assert.AreEqual("ㄱ", pHangul.ToString()); pHangul.DoRemove(); Assert.AreEqual("", pHangul.ToString()); }