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                         TestParse ();
103                         TestToString ();
104
105                 }
106         }
107 }
108
109 namespace MonoTests.System
110 {
111         public class RunCharTest : CharTest
112         {
113                 protected override void RunTest ()
114                 {
115                         TestCompareTo ();
116                         TestEquals ();
117                         TestGetHashValue ();
118                         TestGetNumericValue ();
119                         TestGetUnicodeCategory ();
120                         TestIsControl ();
121                         TestIsDigit ();
122                         TestIsLetter ();
123                         TestIsLetterOrDigit ();
124                         TestIsLower ();
125                         TestIsNumber ();
126                         TestIsPunctuation ();
127                         TestIsSeparator ();
128                         TestIsSurrogate ();
129                         TestIsSymbol ();
130                         TestIsUpper ();
131                         TestIsWhiteSpace ();
132                         TestParse ();
133                         TestToLower ();
134                         TestToUpper ();
135                         TestToString ();
136                         TestGetTypeCode ();
137
138                 }
139         }
140 }
141
142 namespace MonoTests.System
143 {
144         public class RunConsoleTest : ConsoleTest
145         {
146                 protected override void RunTest ()
147                 {
148                         TestError ();
149                         TestIn ();
150                         TestOut ();
151                         TestOpenStandardError ();
152                         TestOpenStandardInput ();
153                         TestOpenStandardOutput ();
154                         TestRead ();
155                         TestReadLine ();
156                         TestSetError ();
157                         TestSetIn ();
158                         TestSetOut ();
159                         TestWrite ();
160                         TestWriteLine ();
161
162                 }
163         }
164 }
165
166 namespace MonoTests.System
167 {
168         public class RunEnumTest : EnumTest
169         {
170                 protected override void RunTest ()
171                 {
172                         TestCompareTo ();
173                         TestEquals ();
174                         TestFormat ();
175                         TestGetHashCode ();
176                         TestGetNames ();
177                         TestGetTypeCode ();
178                         TestGetUnderlyingType ();
179                         TestGetValues ();
180                         TestIsDefined ();
181                         TestParse1 ();
182                         TestParse2 ();
183                         TestToObject ();
184                         TestToString ();
185
186                 }
187         }
188 }
189
190 namespace MonoTests.System
191 {
192         public class RunDecimalTest : DecimalTest
193         {
194                 protected override void RunTest ()
195                 {
196                         TestToString ();
197                         TestCurrencyPattern ();
198                         TestNumberNegativePattern ();
199                         TestPercentPattern ();
200                         TestParse ();
201                         TestConstants ();
202                         TestConstructInt32 ();
203                         TestConstructUInt32 ();
204                         TestConstructInt64 ();
205                         TestConstructUInt64 ();
206                         TestConstructSingle ();
207                         TestConstructSingleRounding ();
208                         TestConstructDouble ();
209                         TestConstructDoubleRound ();
210                         TestNegate ();
211                         TestPartConstruct ();
212                         TestFloorTruncate ();
213                         TestRound ();
214
215                 }
216         }
217 }
218
219 namespace MonoTests.System
220 {
221         public class RunDecimalTest2 : DecimalTest2
222         {
223                 protected override void RunTest ()
224                 {
225                         TestCompare ();
226                         TestRemainder ();
227                         TestAdd ();
228                         TestMult ();
229                         TestDiv ();
230
231                 }
232         }
233 }
234
235 namespace MonoTests.System
236 {
237         public class RunGuidTest : GuidTest
238         {
239                 protected override void RunTest ()
240                 {
241                         TestCtor1 ();
242                         TestCtor2 ();
243                         TestCtor4 ();
244                         TestCtor5 ();
245                         TestEmpty ();
246                         TestNewGuid ();
247                         TestEqualityOp ();
248                         TestInequalityOp ();
249                         TestEquals ();
250                         TestCompareTo ();
251                         TestGetHashCode ();
252                         TestToByteArray ();
253                         TestToString ();
254
255                 }
256         }
257 }
258
259 namespace MonoTests.System
260 {
261         public class RunInt16Test : Int16Test
262         {
263                 protected override void RunTest ()
264                 {
265                         TestMinMax ();
266                         TestCompareTo ();
267                         TestEquals ();
268                         TestGetHashCode ();
269                         TestParse ();
270                         TestToString ();
271
272                 }
273         }
274 }
275
276 namespace MonoTests.System
277 {
278         public class RunInt32Test : Int32Test
279         {
280                 protected override void RunTest ()
281                 {
282                         TestMinMax ();
283                         TestCompareTo ();
284                         TestEquals ();
285                         TestGetHashCode ();
286                         TestParse ();
287                         TestToString ();
288                         TestCustomToString ();
289
290                 }
291         }
292 }
293
294 namespace MonoTests.System
295 {
296         public class RunInt64Test : Int64Test
297         {
298                 protected override void RunTest ()
299                 {
300                         TestMinMax ();
301                         TestCompareTo ();
302                         TestEquals ();
303                         TestGetHashCode ();
304                         TestRoundTripGeneral ();
305                         TestRoundTripHex ();
306                         TestParseNull ();
307                         TestParse ();
308                         TestToString ();
309                         TestUserCurrency ();
310                         TestUserPercent ();
311
312                 }
313         }
314 }
315
316 namespace MonoTests.System
317 {
318         public class RunObjectTest : ObjectTest
319         {
320                 protected override void RunTest ()
321                 {
322                         TestCtor ();
323                         TestEquals1 ();
324                         TestEquals2 ();
325                         TestGetHashCode ();
326                         TestGetType ();
327                         TestReferenceEquals ();
328                         TestToString ();
329
330                 }
331         }
332 }
333
334 namespace MonoTests.System
335 {
336         public class RunResolveEventArgsTest : ResolveEventArgsTest
337         {
338                 protected override void RunTest ()
339                 {
340                         TestTheWholeThing ();
341
342                 }
343         }
344 }
345
346 namespace MonoTests.System
347 {
348         public class RunStringTest : StringTest
349         {
350                 protected override void RunTest ()
351                 {
352                         TestLength ();
353                         TestCompare ();
354                         TestCompareOrdinal ();
355                         TestCompareTo ();
356                         TestConcat ();
357                         TestCopy ();
358                         TestCopyTo ();
359                         TestEndsWith ();
360                         TestEquals ();
361                         TestFormat ();
362                         TestGetEnumerator ();
363                         TestGetHashCode ();
364                         TestGetType ();
365                         TestGetTypeCode ();
366                         TestIndexOf ();
367                         TestIndexOfAny ();
368                         TestInsert ();
369                         TestIntern ();
370                         TestIsInterned ();
371                         TestJoin ();
372                         TestLastIndexOf ();
373                         TestLastIndexOfAny ();
374                         TestPadLeft ();
375                         TestPadRight ();
376                         TestRemove ();
377                         TestReplace ();
378                         TestSplit ();
379                         TestStartsWith ();
380                         TestSubstring ();
381                         TestToCharArray ();
382                         TestToLower ();
383                         TestToString ();
384                         TestToUpper ();
385                         TestTrim ();
386                         TestTrimEnd ();
387                         TestTrimStart ();
388
389                 }
390         }
391 }
392
393 namespace MonoTests.System
394 {
395         public class RunTimeSpanTest : TimeSpanTest
396         {
397                 protected override void RunTest ()
398                 {
399                         TestCtors ();
400                         TestProperties ();
401                         TestAdd ();
402                         TestCompare ();
403                         TestNegateAndDuration ();
404                         TestEquals ();
405                         TestFromXXXX ();
406                         TestGetHashCode ();
407                         TestParse ();
408                         TestSubstract ();
409                         TestToString ();
410
411                 }
412         }
413 }
414
415 namespace MonoTests.System
416 {
417         public class RunUInt16Test : UInt16Test
418         {
419                 protected override void RunTest ()
420                 {
421                         TestMinMax ();
422                         TestCompareTo ();
423                         TestEquals ();
424                         TestGetHashCode ();
425                         TestParse ();
426                         TestToString ();
427
428                 }
429         }
430 }
431
432 namespace MonoTests.System
433 {
434         public class RunUInt32Test : UInt32Test
435         {
436                 protected override void RunTest ()
437                 {
438                         TestMinMax ();
439                         TestCompareTo ();
440                         TestEquals ();
441                         TestGetHashCode ();
442                         TestParse ();
443                         TestToString ();
444
445                 }
446         }
447 }
448
449 namespace MonoTests.System
450 {
451         public class RunUInt64Test : UInt64Test
452         {
453                 protected override void RunTest ()
454                 {
455                         TestMinMax ();
456                         TestCompareTo ();
457                         TestEquals ();
458                         TestGetHashCode ();
459                         TestParse ();
460                         TestToString ();
461
462                 }
463         }
464 }
465
466 namespace MonoTests.System
467 {
468         public class RunDoubleTest : DoubleTest
469         {
470                 protected override void RunTest ()
471                 {
472                         TestPublicFields ();
473                         TestCompareTo ();
474                         TestEquals ();
475                         TestTypeCode ();
476                         TestIsInfinity ();
477                         TestIsNan ();
478                         TestIsNegativeInfinity ();
479                         TestIsPositiveInfinity ();
480                         TestParse ();
481                         TestToString ();
482
483                 }
484         }
485 }
486
487 namespace MonoTests.System
488 {
489         public class RunTimeZoneTest : TimeZoneTest
490         {
491                 protected override void RunTest ()
492                 {
493                         TestCtors ();
494
495                 }
496         }
497 }
498
499 namespace MonoTests.System
500 {
501         public class RunDateTimeTest : DateTimeTest
502         {
503                 protected override void RunTest ()
504                 {
505                         TestCtors ();
506                         TestToString ();
507                         TestParseExact ();
508                         TestParse ();
509
510                 }
511         }
512 }
513
514 namespace MonoTests
515 {
516         public class RunAllTests
517         {
518                 public static void AddAllTests (TestSuite suite)
519                 {
520                         suite.AddTest (new MonoTests.System.RunArrayTest ());
521                         suite.AddTest (new MonoTests.System.RunBitConverterTest ());
522                         suite.AddTest (new MonoTests.System.RunBooleanTest ());
523                         suite.AddTest (new MonoTests.System.RunByteTest ());
524                         suite.AddTest (new MonoTests.System.RunCharTest ());
525                         suite.AddTest (new MonoTests.System.RunConsoleTest ());
526                         suite.AddTest (new MonoTests.System.RunEnumTest ());
527                         suite.AddTest (new MonoTests.System.RunDecimalTest ());
528                         suite.AddTest (new MonoTests.System.RunDecimalTest2 ());
529                         suite.AddTest (new MonoTests.System.RunGuidTest ());
530                         suite.AddTest (new MonoTests.System.RunInt16Test ());
531                         suite.AddTest (new MonoTests.System.RunInt32Test ());
532                         suite.AddTest (new MonoTests.System.RunInt64Test ());
533                         suite.AddTest (new MonoTests.System.RunObjectTest ());
534                         suite.AddTest (new MonoTests.System.RunResolveEventArgsTest ());
535                         suite.AddTest (new MonoTests.System.RunStringTest ());
536                         suite.AddTest (new MonoTests.System.RunTimeSpanTest ());
537                         suite.AddTest (new MonoTests.System.RunUInt16Test ());
538                         suite.AddTest (new MonoTests.System.RunUInt32Test ());
539                         suite.AddTest (new MonoTests.System.RunUInt64Test ());
540                         suite.AddTest (new MonoTests.System.RunDoubleTest ());
541                         suite.AddTest (new MonoTests.System.RunTimeZoneTest ());
542                         suite.AddTest (new MonoTests.System.RunDateTimeTest ());
543                 }
544         }
545 }
546
547 class MainApp
548 {
549         public static void Main()
550         {
551                 Thread.CurrentThread.CurrentCulture = new CultureInfo ("en-US");
552
553                 TestResult result = new TestResult ();
554                 TestSuite suite = new TestSuite ();
555                 MonoTests.RunAllTests.AddAllTests (suite);
556                 suite.Run (result);
557                 MonoTests.MyTestRunner.Print (result);
558         }
559 }
560