OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 library unittest.test_case; | 5 library unittest.test_case; |
6 | 6 |
7 import '../unittest.dart'; | 7 /// This is a stub class used to preserve compatibility with unittest 0.11.*. |
8 | 8 /// |
9 /// An individual unit test. | 9 /// It will be removed before the next version is released. |
| 10 @deprecated |
10 abstract class TestCase { | 11 abstract class TestCase { |
11 /// A unique numeric identifier for this test case. | |
12 int get id; | 12 int get id; |
13 | |
14 /// A description of what the test is specifying. | |
15 String get description; | 13 String get description; |
16 | |
17 /// The error or failure message for the tests. | |
18 /// | |
19 /// Initially an empty string. | |
20 String get message; | 14 String get message; |
21 | |
22 /// The result of the test case. | |
23 /// | |
24 /// If the test case has is completed, this will be one of [PASS], [FAIL], or | |
25 /// [ERROR]. Otherwise, it will be `null`. | |
26 String get result; | 15 String get result; |
27 | |
28 /// Returns whether this test case passed. | |
29 bool get passed; | 16 bool get passed; |
30 | |
31 /// The stack trace for the error that caused this test case to fail, or | |
32 /// `null` if it succeeded. | |
33 StackTrace get stackTrace; | 17 StackTrace get stackTrace; |
34 | |
35 /// The name of the group within which this test is running. | |
36 String get currentGroup; | 18 String get currentGroup; |
37 | |
38 /// The time the test case started running. | |
39 /// | |
40 /// `null` if the test hasn't yet begun running. | |
41 DateTime get startTime; | 19 DateTime get startTime; |
42 | |
43 /// The amount of time the test case took. | |
44 /// | |
45 /// `null` if the test hasn't finished running. | |
46 Duration get runningTime; | 20 Duration get runningTime; |
47 | |
48 /// Whether this test is enabled. | |
49 /// | |
50 /// Disabled tests won't be run. | |
51 bool get enabled; | 21 bool get enabled; |
52 | 22 final isComplete = false; |
53 /// Whether this test case has finished running. | |
54 bool get isComplete => !enabled || result != null; | |
55 } | 23 } |
OLD | NEW |