feat: 实现起卦、设置与积分系统
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
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);
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user