Files
AutoGPT/classic/frontend/lib/models/test_suite.dart
Swifty ef7cfbb860 refactor: AutoGPT Platform Stealth Launch Repo Re-Org (#8113)
Restructuring the Repo to make it clear the difference between classic autogpt and the autogpt platform:
* Move the "classic" projects `autogpt`, `forge`, `frontend`, and `benchmark` into a `classic` folder
  * Also rename `autogpt` to `original_autogpt` for absolute clarity
* Rename `rnd/` to `autogpt_platform/`
  * `rnd/autogpt_builder` -> `autogpt_platform/frontend`
  * `rnd/autogpt_server` -> `autogpt_platform/backend`
* Adjust any paths accordingly
2024-09-20 16:50:43 +02:00

26 lines
694 B
Dart

import 'package:auto_gpt_flutter_client/models/task.dart';
class TestSuite {
final String timestamp;
final List<Task> tests;
TestSuite({required this.timestamp, required this.tests});
// Serialization: Convert the object into a Map
Map<String, dynamic> toJson() {
return {
'timestamp': timestamp,
'tests': tests.map((task) => task.toJson()).toList(),
};
}
// Deserialization: Create an object from a Map
factory TestSuite.fromJson(Map<String, dynamic> json) {
return TestSuite(
timestamp: json['timestamp'],
tests: List<Task>.from(json['tests'].map(
(taskJson) => Task.fromMap(Map<String, dynamic>.from(taskJson)))),
);
}
}