-
Notifications
You must be signed in to change notification settings - Fork 150
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
56 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import 'package:patrol_log/patrol_log.dart'; | ||
|
||
/// Represents a single test entry. | ||
/// | ||
/// A single test entry is a collection of entries that belong to the same test. | ||
/// It starts with a [TestEntry] with status [TestEntryStatus.start] or | ||
/// [TestEntryStatus.skip]. | ||
/// Entry with skip status contains only one entry. | ||
/// Entry with start status contains also [StepEntry] and [LogEntry] entries. | ||
/// The last entry in the collection is a test entry with status | ||
/// [TestEntryStatus.success] or [TestEntryStatus.failure]. | ||
class PatrolSingleTestEntry { | ||
PatrolSingleTestEntry(this.entries); | ||
|
||
final List<Entry> entries; | ||
|
||
/// The name of the test. | ||
String get name => | ||
(entries.firstWhere((t) => t is TestEntry) as TestEntry).name; | ||
|
||
/// The status of the test. | ||
TestEntryStatus get status => | ||
(entries.lastWhere((t) => t is TestEntry) as TestEntry).status; | ||
|
||
/// The name of the test with the path. | ||
String get nameWithPath => | ||
(entries.lastWhere((t) => t is TestEntry) as TestEntry).nameWithPath; | ||
} |