Updated.
[mono.git] / mcs / class / corlib / Test / TheTests.cs
1 using NUnit.Framework;
2 using System;
3 using System.Threading;
4 using System.Globalization;
5
6 namespace MonoTests.System
7 {
8         public class RunArrayTest : ArrayTest
9         {
10                 protected override void RunTest ()
11                 {
12                         TestIsFixedSize ();
13                         TestIsReadOnly ();
14                         TestIsSynchronized ();
15                         TestLength ();
16                         TestRank ();
17                         TestBinarySearch1 ();
18                         TestBinarySearch2 ();
19                         TestClear ();
20                         TestClone ();
21                         TestCopy ();
22                         TestCopy2 ();
23                         TestCopyTo ();
24                         TestCreateInstance ();
25                         TestGetEnumerator ();
26                         TestGetLength ();
27                         TestGetLowerBound ();
28                         TestGetUpperBound ();
29                         TestGetValue1 ();
30                         TestGetValue2 ();
31                         TestGetValue3 ();
32                         TestGetValueN ();
33                         TestIndexOf1 ();
34                         TestIndexOf2 ();
35                         TestIndexOf3 ();
36                         TestLastIndexOf1 ();
37                         TestLastIndexOf2 ();
38                         TestLastIndexOf3 ();
39                         TestReverse ();
40                         TestSetValue1 ();
41                         TestSetValue2 ();
42                         TestSetValue3 ();
43                         TestSetValueN ();
44                         TestSort ();
45
46                 }
47         }
48 }
49
50 namespace MonoTests.System
51 {
52         public class RunBitConverterTest : BitConverterTest
53         {
54                 protected override void RunTest ()
55                 {
56                         TestIsLittleEndian ();
57                         TestSingle ();
58                         TestDouble ();
59                         TestBool ();
60                         TestChar ();
61                         TestInt16 ();
62                         TestUInt16 ();
63                         TestInt32 ();
64                         TestUInt32 ();
65                         TestInt64 ();
66                         TestUInt64 ();
67                         TestToString ();
68
69                 }
70         }
71 }
72
73 namespace MonoTests.System
74 {
75         public class RunBooleanTest : BooleanTest
76         {
77                 protected override void RunTest ()
78                 {
79                         TestStrings ();
80                         TestCompareTo ();
81                         TestEquals ();
82                         TestGetHashCode ();
83                         TestGetType ();
84                         TestGetTypeCode ();
85                         TestParse ();
86                         TestToString ();
87
88                 }
89         }
90 }
91
92 namespace MonoTests.System
93 {
94         public class RunByteTest : ByteTest
95         {
96                 protected override void RunTest ()
97                 {
98                         TestMinMax ();
99                         TestCompareTo ();
100                         TestEquals ();
101                         TestGetHashCode ();
102                         TestToString ();
103
104                 }
105         }
106 }
107
108 namespace MonoTests.System
109 {
110         public class RunCharTest : CharTest
111         {
112                 protected override void RunTest ()
113                 {
114                         TestCompareTo ();
115                         TestEquals ();
116                         TestGetHashValue ();
117                         TestGetNumericValue ();
118                         TestGetUnicodeCategory ();
119                         TestIsControl ();
120                         TestIsDigit ();
121                         TestIsLetter ();
122                         TestIsLetterOrDigit ();
123                         TestIsLower ();
124                         TestIsNumber ();
125                         TestIsPunctuation ();
126                         TestIsSeparator ();
127                         TestIsSurrogate ();
128                         TestIsSymbol ();
129                         TestIsUpper ();
130                         TestIsWhiteSpace ();
131                         TestParse ();
132                         TestToLower ();
133                         TestToUpper ();
134                         TestToString ();
135                         TestGetTypeCode ();
136
137                 }
138         }
139 }
140
141 namespace MonoTests.System
142 {
143         public class RunConsoleTest : ConsoleTest
144         {
145                 protected override void RunTest ()
146                 {
147                         TestError ();
148                         TestIn ();
149                         TestOut ();
150                         TestOpenStandardError ();
151                         TestOpenStandardInput ();
152                         TestOpenStandardOutput ();
153                         TestRead ();
154                         TestReadLine ();
155                         TestSetError ();
156                         TestSetIn ();
157                         TestSetOut ();
158                         TestWrite ();
159                         TestWriteLine ();
160
161                 }
162         }
163 }
164
165 namespace MonoTests.System
166 {
167         public class RunEnumTest : EnumTest
168         {
169                 protected override void RunTest ()
170                 {
171                         TestCompareTo ();
172                         TestEquals ();
173                         TestFormat ();
174                         TestGetHashCode ();
175                         TestGetNames ();
176                         TestGetTypeCode ();
177                         TestGetUnderlyingType ();
178                         TestGetValues ();
179                         TestIsDefined ();
180                         TestParse1 ();
181                         TestParse2 ();
182                         TestToObject ();
183                         TestToString ();
184
185                 }
186         }
187 }
188
189 namespace MonoTests.System
190 {
191         public class RunDecimalTest : DecimalTest
192         {
193                 protected override void RunTest ()
194                 {
195                         TestToString ();
196                         TestCurrencyPattern ();
197                         TestNumberNegativePattern ();
198                         TestPercentPattern ();
199                         TestParse ();
200                         TestConstants ();
201                         TestConstructInt32 ();
202                         TestConstructUInt32 ();
203                         TestConstructInt64 ();
204                         TestConstructUInt64 ();
205                         TestConstructSingle ();
206                         TestConstructSingleRounding ();
207                         TestConstructDouble ();
208                         TestConstructDoubleRound ();
209                         TestNegate ();
210                         TestPartConstruct ();
211                         TestFloorTruncate ();
212                         TestRound ();
213
214                 }
215         }
216 }
217
218 namespace MonoTests.System
219 {
220         public class RunDecimalTest2 : DecimalTest2
221         {
222                 protected override void RunTest ()
223                 {
224                         TestCompare ();
225                         TestRemainder ();
226                         TestAdd ();
227                         TestMult ();
228                         TestDiv ();
229
230                 }
231         }
232 }
233
234 namespace MonoTests.System
235 {
236         public class RunGuidTest : GuidTest
237         {
238                 protected override void RunTest ()
239                 {
240                         TestCtor1 ();
241                         TestCtor2 ();
242                         TestCtor4 ();
243                         TestCtor5 ();
244                         TestEmpty ();
245                         TestNewGuid ();
246                         TestEqualityOp ();
247                         TestInequalityOp ();
248                         TestEquals ();
249                         TestCompareTo ();
250                         TestGetHashCode ();
251                         TestToByteArray ();
252                         TestToString ();
253
254                 }
255         }
256 }
257
258 namespace MonoTests.System
259 {
260         public class RunInt16Test : Int16Test
261         {
262                 protected override void RunTest ()
263                 {
264                         TestMinMax ();
265                         TestCompareTo ();
266                         TestEquals ();
267                         TestGetHashCode ();
268                         TestParse ();
269                         TestToString ();
270
271                 }
272         }
273 }
274
275 namespace MonoTests.System
276 {
277         public class RunInt32Test : Int32Test
278         {
279                 protected override void RunTest ()
280                 {
281                         TestMinMax ();
282                         TestCompareTo ();
283                         TestEquals ();
284                         TestGetHashCode ();
285                         TestParse ();
286                         TestToString ();
287                         TestCustomToString ();
288
289                 }
290         }
291 }
292
293 namespace MonoTests.System
294 {
295         public class RunInt64Test : Int64Test
296         {
297                 protected override void RunTest ()
298                 {
299                         TestMinMax ();
300                         TestCompareTo ();
301                         TestEquals ();
302                         TestGetHashCode ();
303                         TestRoundTripGeneral ();
304                         TestRoundTripHex ();
305                         TestParseNull ();
306                         TestParse ();
307                         TestToString ();
308                         TestUserCurrency ();
309                         TestUserPercent ();
310
311                 }
312         }
313 }
314
315 namespace MonoTests.System
316 {
317         public class RunObjectTest : ObjectTest
318         {
319                 protected override void RunTest ()
320                 {
321                         TestCtor ();
322                         TestEquals1 ();
323                         TestEquals2 ();
324                         TestGetHashCode ();
325                         TestGetType ();
326                         TestReferenceEquals ();
327                         TestToString ();
328
329                 }
330         }
331 }
332
333 namespace MonoTests.System
334 {
335         public class RunResolveEventArgsTest : ResolveEventArgsTest
336         {
337                 protected override void RunTest ()
338                 {
339                         TestTheWholeThing ();
340
341                 }
342         }
343 }
344
345 namespace MonoTests.System
346 {
347         public class RunStringTest : StringTest
348         {
349                 protected override void RunTest ()
350                 {
351                         TestLength ();
352                         TestCompare ();
353                         TestCompareOrdinal ();
354                         TestCompareTo ();
355                         TestConcat ();
356                         TestCopy ();
357                         TestCopyTo ();
358                         TestEndsWith ();
359                         TestEquals ();
360                         TestFormat ();
361                         TestGetEnumerator ();
362                         TestGetHashCode ();
363                         TestGetType ();
364                         TestGetTypeCode ();
365                         TestIndexOf ();
366                         TestIndexOfAny ();
367                         TestInsert ();
368                         TestIntern ();
369                         TestIsInterned ();
370                         TestJoin ();
371                         TestLastIndexOf ();
372                         TestLastIndexOfAny ();
373                         TestPadLeft ();
374                         TestPadRight ();
375                         TestRemove ();
376                         TestReplace ();
377                         TestSplit ();
378                         TestStartsWith ();
379                         TestSubstring ();
380                         TestToCharArray ();
381                         TestToLower ();
382                         TestToString ();
383                         TestToUpper ();
384                         TestTrim ();
385                         TestTrimEnd ();
386                         TestTrimStart ();
387
388                 }
389         }
390 }
391
392 namespace MonoTests.System
393 {
394         public class RunTimeSpanTest : TimeSpanTest
395         {
396                 protected override void RunTest ()
397                 {
398                         TestCtors ();
399                         TestProperties ();
400                         TestAdd ();
401                         TestCompare ();
402                         TestNegateAndDuration ();
403                         TestEquals ();
404                         TestFromXXXX ();
405                         TestGetHashCode ();
406                         TestParse ();
407                         TestSubstract ();
408                         TestToString ();
409
410                 }
411         }
412 }
413
414 namespace MonoTests.System
415 {
416         public class RunUInt16Test : UInt16Test
417         {
418                 protected override void RunTest ()
419                 {
420                         TestMinMax ();
421                         TestCompareTo ();
422                         TestEquals ();
423                         TestGetHashCode ();
424                         TestParse ();
425                         TestToString ();
426
427                 }
428         }
429 }
430
431 namespace MonoTests.System
432 {
433         public class RunUInt32Test : UInt32Test
434         {
435                 protected override void RunTest ()
436                 {
437                         TestMinMax ();
438                         TestCompareTo ();
439                         TestEquals ();
440                         TestGetHashCode ();
441                         TestParse ();
442                         TestToString ();
443
444                 }
445         }
446 }
447
448 namespace MonoTests.System
449 {
450         public class RunUInt64Test : UInt64Test
451         {
452                 protected override void RunTest ()
453                 {
454                         TestMinMax ();
455                         TestCompareTo ();
456                         TestEquals ();
457                         TestGetHashCode ();
458                         TestParse ();
459                         TestToString ();
460
461                 }
462         }
463 }
464
465 namespace MonoTests.System
466 {
467         public class RunDoubleTest : DoubleTest
468         {
469                 protected override void RunTest ()
470                 {
471                         TestPublicFields ();
472                         TestCompareTo ();
473                         TestEquals ();
474                         TestTypeCode ();
475                         TestIsInfinity ();
476                         TestIsNan ();
477                         TestIsNegativeInfinity ();
478                         TestIsPositiveInfinity ();
479                         TestParse ();
480                         TestToString ();
481
482                 }
483         }
484 }
485
486 namespace MonoTests.System
487 {
488         public class RunTimeZoneTest : TimeZoneTest
489         {
490                 protected override void RunTest ()
491                 {
492                         TestCtors ();
493
494                 }
495         }
496 }
497
498 namespace MonoTests.System
499 {
500         public class RunDateTimeTest : DateTimeTest
501         {
502                 protected override void RunTest ()
503                 {
504                         TestCtors ();
505                         TestToString ();
506                         TestParseExact ();
507                         TestParse ();
508
509                 }
510         }
511 }
512
513 namespace MonoTests
514 {
515         public class RunAllTests
516         {
517                 public static void AddAllTests (TestSuite suite)
518                 {
519                         suite.AddTest (new MonoTests.System.RunArrayTest ());
520                         suite.AddTest (new MonoTests.System.RunBitConverterTest ());
521                         suite.AddTest (new MonoTests.System.RunBooleanTest ());
522                         suite.AddTest (new MonoTests.System.RunByteTest ());
523                         suite.AddTest (new MonoTests.System.RunCharTest ());
524                         suite.AddTest (new MonoTests.System.RunConsoleTest ());
525                         suite.AddTest (new MonoTests.System.RunEnumTest ());
526                         suite.AddTest (new MonoTests.System.RunDecimalTest ());
527                         suite.AddTest (new MonoTests.System.RunDecimalTest2 ());
528                         suite.AddTest (new MonoTests.System.RunGuidTest ());
529                         suite.AddTest (new MonoTests.System.RunInt16Test ());
530                         suite.AddTest (new MonoTests.System.RunInt32Test ());
531                         suite.AddTest (new MonoTests.System.RunInt64Test ());
532                         suite.AddTest (new MonoTests.System.RunObjectTest ());
533                         suite.AddTest (new MonoTests.System.RunResolveEventArgsTest ());
534                         suite.AddTest (new MonoTests.System.RunStringTest ());
535                         suite.AddTest (new MonoTests.System.RunTimeSpanTest ());
536                         suite.AddTest (new MonoTests.System.RunUInt16Test ());
537                         suite.AddTest (new MonoTests.System.RunUInt32Test ());
538                         suite.AddTest (new MonoTests.System.RunUInt64Test ());
539                         suite.AddTest (new MonoTests.System.RunDoubleTest ());
540                         suite.AddTest (new MonoTests.System.RunTimeZoneTest ());
541                         suite.AddTest (new MonoTests.System.RunDateTimeTest ());
542                 }
543         }
544 }
545
546 class MainApp
547 {
548         public static void Main()
549         {
550                 Thread.CurrentThread.CurrentCulture = new CultureInfo ("en-US");
551
552                 TestResult result = new TestResult ();
553                 TestSuite suite = new TestSuite ();
554                 MonoTests.RunAllTests.AddAllTests (suite);
555                 suite.Run (result);
556                 MonoTests.MyTestRunner.Print (result);
557         }
558 }
559