'--------------------------------------------------------------------
' Test case of System.Text.StringBuilder Class
'--------------------------------------------------------------------

Imports System.Text

Namespace StringBuilderTest

Sub TestMain()
	Dim sb = New StringBuilder("Hello")
	UnitTest("StringBuilder - Constractor & ToString", sb.ToString(), "Hello")
	UnitTest("StringBuilder.ToString(index, count)", sb.ToString(1, 3), "ell")
	UnitTest("StringBuilder.Append", sb.Append("StringBuilder").ToString(), "HelloStringBuilder")
	UnitTest("StringBuilder.Insert (String)", sb.Insert(5, ", ").ToString(), "Hello, StringBuilder")
	sb.Length = 0
	UnitTest("StringBuilder.Length = 0", sb.ToString(), "")
	sb.Append("でてこいでてこいいけのこい")
	sb.Replace("こい", "いけ").Replace("いけ", "こい")
	UnitTest("StringBuilder.Replace (String)", sb.ToString(), "でてこいでてこいこいのこい")
	sb.Length = 0
	sb.Append(123)
	UnitTest("StringBuilder.Append (Long)", sb.ToString(), "123")
End Sub

End Namespace 'ActiveBasic_StringsTest

StringBuilderTest.TestMain()
