- Timestamp:
- Nov 9, 2008, 2:36:29 PM (16 years ago)
- Location:
- trunk/ab5.0/ablib/TestCase/SimpleTestCase
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ab5.0/ablib/TestCase/SimpleTestCase/CollectionTest.ab
r537 r656 9 9 d.Add("茶", "Tea") 10 10 11 UnitTest("Dictionary.Add, Item (1)", d.Item["赤"] ="Red")12 UnitTest("Dictionary.Add, Item (2)", d.Item["黄"] ="Yellow")13 UnitTest("Dictionary.Add, Item (3)", d.Item("緑") ="Green")14 UnitTest("Dictionary.Add, Item (4)", d.Item("青") ="Blue")11 UnitTest("Dictionary.Add, Item (1)", d.Item["赤"], "Red") 12 UnitTest("Dictionary.Add, Item (2)", d.Item["黄"], "Yellow") 13 UnitTest("Dictionary.Add, Item (3)", d.Item("緑"), "Green") 14 UnitTest("Dictionary.Add, Item (4)", d.Item("青"), "Blue") 15 15 16 16 UnitTest("Dictionary.Remove", d.Remove("茶")) -
trunk/ab5.0/ablib/TestCase/SimpleTestCase/DelegateTest.ab
r569 r656 5 5 Public 6 6 Sub StringEx( str As String ) 7 String( str)7 String( StrPtr(str), str.Length ) 8 8 End Sub 9 9 End Class … … 119 119 120 120 Dim dg7 = New Callback7( AddressOf(TestClass.Proc7) ) ' 共変戻り値サポートのテスト 121 UnitTest( "Delegate2", dg7( "test value" ) ="Proc7 result[test value]" )121 UnitTest( "Delegate2", dg7( "test value" ), "Proc7 result[test value]" ) 122 122 123 123 Dim dg184 = New CallbackTicket184( AddressOf( testObj.Ticket184 ) ) -
trunk/ab5.0/ablib/TestCase/SimpleTestCase/GCHandleTest.ab
r383 r656 21 21 End Namespace 22 22 23 GCHandleTest.TestMain()23 'GCHandleTest.TestMain() -
trunk/ab5.0/ablib/TestCase/SimpleTestCase/Generics.ab
r613 r656 31 31 ' TODO: より多くのパターンで試す必要あり 32 32 Dim bar = New Bar<Long> 33 UnitTest( "Generic ... complex", bar.GetTypeName( New String() ) ="String" )33 UnitTest( "Generic ... complex", bar.GetTypeName( New String() ), "String" ) 34 34 End Sub 35 35 -
trunk/ab5.0/ablib/TestCase/SimpleTestCase/ObjectTest.ab
r232 r656 18 18 UnitTest( "Object.GetHashCode", obj1.GetHashCode() = ObjPtr( obj1 ) ) 19 19 20 UnitTest( "Object.ToString", obj1.ToString() ="Object" )20 UnitTest( "Object.ToString", obj1.ToString(), "Object" ) 21 21 22 UnitTest( "Object.GetType", obj1.GetType().Name ="Object" )22 UnitTest( "Object.GetType", obj1.GetType().Name, "Object" ) 23 23 End Sub 24 24 25 25 End Namespace 26 26 27 ObjectTest.TestMain()27 'ObjectTest.TestMain() -
trunk/ab5.0/ablib/TestCase/SimpleTestCase/PathTest.ab
r411 r656 9 9 Sub TestMain() 10 10 Dim testPath = New String("C:\Dir.Name\file.name.ext") 11 UnitTest("Path.GetFileName", Path.GetFileName(testPath) ="file.name.ext")11 UnitTest("Path.GetFileName", Path.GetFileName(testPath), "file.name.ext") 12 12 13 UnitTest("Path.GetFileNameWithoutExtension", Path.GetFileNameWithoutExtension(testPath) ="file.name")13 UnitTest("Path.GetFileNameWithoutExtension", Path.GetFileNameWithoutExtension(testPath), "file.name") 14 14 15 15 16 UnitTest("Path.GetExtension", Path.GetExtension(testPath) =".ext")16 UnitTest("Path.GetExtension", Path.GetExtension(testPath), ".ext") 17 17 18 UnitTest("Path.ChangeExtension", Path.ChangeExtension(testPath, ".newExt") ="C:\Dir.Name\file.name.newExt")18 UnitTest("Path.ChangeExtension", Path.ChangeExtension(testPath, ".newExt"), "C:\Dir.Name\file.name.newExt") 19 19 20 20 UnitTest("Path.HasExtension (Case1)", Path.HasExtension(testPath) = True) 21 21 UnitTest("Path.HasExtension (Case2)", Path.HasExtension("fileName") = False) 22 22 23 UnitTest("Path.GetPathRoot", Path.GetPathRoot(testPath) ="C:\")23 UnitTest("Path.GetPathRoot", Path.GetPathRoot(testPath), "C:\") 24 24 25 25 UnitTest("Path.IsPathRooted (Case1)", Path.IsPathRooted(testPath) = True) 26 26 UnitTest("Path.IsPathRooted (Case2)", Path.IsPathRooted("Dir.Name\file.name.ext") = False) 27 27 28 UnitTest("Path.Combine (Case1)", Path.Combine("C:\dir", "filename.txt") ="C:\dir\filename.txt")29 UnitTest("Path.Combine (Case2)", Path.Combine("C:\dir\", "filename.txt") ="C:\dir\filename.txt")28 UnitTest("Path.Combine (Case1)", Path.Combine("C:\dir", "filename.txt"), "C:\dir\filename.txt") 29 UnitTest("Path.Combine (Case2)", Path.Combine("C:\dir\", "filename.txt"), "C:\dir\filename.txt") 30 30 31 31 /* -
trunk/ab5.0/ablib/TestCase/SimpleTestCase/SimpleTestCase.ab
r632 r656 25 25 26 26 'Initialize() 27 28 Dim prevBackColor = System.Console.BackgroundColor29 Dim prevForeColor = System.Console.ForegroundColor30 27 31 28 #include "SimpleTestCase.idx" -
trunk/ab5.0/ablib/TestCase/SimpleTestCase/StreamTest.ab
r477 r656 13 13 UnitTest("sr.Read() - 2", sr.Read() = &h20) 14 14 UnitTest("sr.Peek()", sr.Peek() = &h61) 15 UnitTest("sr.ReadLine() \n", sr.ReadLine() ="abc")16 UnitTest("sr.ReadLine() \r\n", sr.ReadLine() ="123")15 UnitTest("sr.ReadLine() \n", sr.ReadLine(), "abc") 16 UnitTest("sr.ReadLine() \r\n", sr.ReadLine(), "123") 17 17 Dim s = sr.ReadToEnd() 18 UnitTest("sr.ReadToEnd() \r\n", s =Ex"あいうえお\r\nアイウエオ")18 UnitTest("sr.ReadToEnd() \r\n", s, Ex"あいうえお\r\nアイウエオ") 19 19 End Sub 20 20 -
trunk/ab5.0/ablib/TestCase/SimpleTestCase/StringBuilderTest.ab
r468 r656 9 9 Sub TestMain() 10 10 Dim sb = New StringBuilder("Hello") 11 UnitTest("StringBuilder - Constractor & ToString", sb.ToString , "Hello")11 UnitTest("StringBuilder - Constractor & ToString", sb.ToString(), "Hello") 12 12 UnitTest("StringBuilder.ToString(index, count)", sb.ToString(1, 3), "ell") 13 UnitTest("StringBuilder.Append", sb.Append("StringBuilder").ToString , "HelloStringBuilder")14 UnitTest("StringBuilder.Insert (String)", sb.Insert(5, ", ").ToString , "Hello, StringBuilder")13 UnitTest("StringBuilder.Append", sb.Append("StringBuilder").ToString(), "HelloStringBuilder") 14 UnitTest("StringBuilder.Insert (String)", sb.Insert(5, ", ").ToString(), "Hello, StringBuilder") 15 15 sb.Length = 0 16 UnitTest("StringBuilder.Length = 0", sb.ToString , "")16 UnitTest("StringBuilder.Length = 0", sb.ToString(), "") 17 17 sb.Append("でてこいでてこいいけのこい") 18 18 sb.Replace("こい", "いけ").Replace("いけ", "こい") 19 UnitTest("StringBuilder.Replace (String)", sb.ToString , "でてこいでてこいこいのこい")19 UnitTest("StringBuilder.Replace (String)", sb.ToString(), "でてこいでてこいこいのこい") 20 20 sb.Length = 0 21 21 sb.Append(123) 22 UnitTest("StringBuilder.Append (Long)", sb.ToString , "123")22 UnitTest("StringBuilder.Append (Long)", sb.ToString(), "123") 23 23 End Sub 24 24 -
trunk/ab5.0/ablib/TestCase/SimpleTestCase/VersionTest.ab
r299 r656 10 10 Dim v1234 = New System.Version(1, 2, 3, 4) 11 11 12 UnitTest("Version(major, minor)", String.Compare(v12.ToString(), "1.2") = 0)13 UnitTest("Version(major, minor, build)", String.Compare(v123.ToString(), "1.2.3") = 0)14 UnitTest("Version(major, minor, build, revision)", String.Compare(v1234.ToString(), "1.2.3.4") = 0)12 UnitTest("Version(major, minor)", v12.ToString(), "1.2") 13 UnitTest("Version(major, minor, build)", v123.ToString(), "1.2.3") 14 UnitTest("Version(major, minor, build, revision)", v1234.ToString(), "1.2.3.4") 15 15 16 UnitTest("Version.ToString(0)", String.Compare(v1234.ToString(0), "") = 0)17 UnitTest("Version.ToString(1)", String.Compare(v1234.ToString(1), "1") = 0)18 UnitTest("Version.ToString(2)", String.Compare(v1234.ToString(2), "1.2") = 0)19 UnitTest("Version.ToString(3)", String.Compare(v1234.ToString(3), "1.2.3") = 0)20 UnitTest("Version.ToString(4)", String.Compare(v1234.ToString(4), "1.2.3.4") = 0)16 UnitTest("Version.ToString(0)", v1234.ToString(0), "") 17 UnitTest("Version.ToString(1)", v1234.ToString(1), "1") 18 UnitTest("Version.ToString(2)", v1234.ToString(2), "1.2") 19 UnitTest("Version.ToString(3)", v1234.ToString(3), "1.2.3") 20 UnitTest("Version.ToString(4)", v1234.ToString(4), "1.2.3.4") 21 21 22 22 UnitTest("Version.Major", v1234.Major = 1)
Note:
See TracChangeset
for help on using the changeset viewer.