37 lines
1,015 B
Dart
37 lines
1,015 B
Dart
|
|
import 'package:bible_tracker/data/bible.dart';
|
||
|
|
import 'package:flutter_test/flutter_test.dart';
|
||
|
|
|
||
|
|
void main() {
|
||
|
|
group('Bible', () {
|
||
|
|
test('has 66 books', () {
|
||
|
|
expect(Bible.books.length, 66);
|
||
|
|
expect(Bible.totalBooks, 66);
|
||
|
|
});
|
||
|
|
|
||
|
|
test('has 1189 chapters across all books', () {
|
||
|
|
expect(Bible.totalChapters, 1189);
|
||
|
|
});
|
||
|
|
|
||
|
|
test('old testament totals match canon', () {
|
||
|
|
expect(Bible.totalBooksIn(Testament.old), 39);
|
||
|
|
expect(Bible.totalChaptersIn(Testament.old), 929);
|
||
|
|
});
|
||
|
|
|
||
|
|
test('new testament totals match canon', () {
|
||
|
|
expect(Bible.totalBooksIn(Testament.newT), 27);
|
||
|
|
expect(Bible.totalChaptersIn(Testament.newT), 260);
|
||
|
|
});
|
||
|
|
|
||
|
|
test('indexes are contiguous from 0 to 65', () {
|
||
|
|
for (int i = 0; i < Bible.books.length; i++) {
|
||
|
|
expect(Bible.books[i].index, i);
|
||
|
|
}
|
||
|
|
});
|
||
|
|
|
||
|
|
test('chapterKey produces stable strings', () {
|
||
|
|
expect(Bible.chapterKey(0, 1), '0:1');
|
||
|
|
expect(Bible.chapterKey(65, 22), '65:22');
|
||
|
|
});
|
||
|
|
});
|
||
|
|
}
|