mirror of
https://github.com/GitJournal/GitJournal.git
synced 2025-09-11 21:43:47 +08:00

It seems like we need to explicitly mention the test package in the dev dependencies. This is strange, since the documentation does not reflect that.
28 lines
672 B
Dart
28 lines
672 B
Dart
import 'package:journal/note.dart';
|
|
import 'package:journal/storage/serializers.dart';
|
|
|
|
import 'package:test/test.dart';
|
|
|
|
main() {
|
|
group('Serializers', () {
|
|
var note =
|
|
Note(id: "2", body: "This is the body", created: new DateTime.now());
|
|
|
|
test('JSON Serializer', () {
|
|
var serializer = new JsonNoteSerializer();
|
|
var str = serializer.encode(note);
|
|
var note2 = serializer.decode(str);
|
|
|
|
expect(note2, note);
|
|
});
|
|
|
|
test('Markdown Serializer', () {
|
|
var serializer = new MarkdownYAMLSerializer();
|
|
var str = serializer.encode(note);
|
|
var note2 = serializer.decode(str);
|
|
|
|
expect(note2, note);
|
|
});
|
|
});
|
|
}
|