37 lines
1.2 KiB
Dart
37 lines
1.2 KiB
Dart
import 'package:flutter_test/flutter_test.dart';
|
|
import 'package:meeyao_qianwen/features/divination/data/models/divination_params.dart';
|
|
import 'package:meeyao_qianwen/features/divination/data/services/divination_result_builder.dart';
|
|
|
|
void main() {
|
|
final builder = DivinationResultBuilder();
|
|
|
|
test('build returns result with hexagram names and section text', () {
|
|
final params = DivinationMockData.initial().copyWith(
|
|
method: DivinationMethod.auto,
|
|
question: '近期工作是否会有突破',
|
|
questionType: QuestionType.career,
|
|
);
|
|
|
|
final result = builder.build(
|
|
params: params,
|
|
yaoStates: const [
|
|
YaoType.youngYang,
|
|
YaoType.youngYin,
|
|
YaoType.oldYang,
|
|
YaoType.youngYin,
|
|
YaoType.oldYin,
|
|
YaoType.youngYang,
|
|
],
|
|
);
|
|
|
|
expect(result.guaName, isNotEmpty);
|
|
expect(result.targetGuaName, isNotEmpty);
|
|
expect(result.binaryCode, hasLength(6));
|
|
expect(result.changedBinaryCode, hasLength(6));
|
|
expect(result.keywords, contains('签'));
|
|
expect(result.conclusion, contains('这个卦象的结果为'));
|
|
expect(result.yaoLines.length, 6);
|
|
expect(result.targetYaoLines.length, 6);
|
|
});
|
|
}
|