当前位置: 首页>>代码示例>>C++>>正文


C++ TA::setValue方法代码示例

本文整理汇总了C++中TA::setValue方法的典型用法代码示例。如果您正苦于以下问题:C++ TA::setValue方法的具体用法?C++ TA::setValue怎么用?C++ TA::setValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TA的用法示例。


在下文中一共展示了TA::setValue方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1:

TEST_F(Invaliditetsdaekning_KI_OSV_25_49, Invaliditetsdaekning_Kortvarig_Overbygning_Obligatorisk) {
	RuleEngine::_printDebugAtValidation = true;
	TA ta { "15124040" };
	ta.setValue(kKortTAE_Daekning, "Obligatorisk");

	auto r = re.validate(ta, false);
//	if (!r.isAllOk())
		cout << r;
	EXPECT_FALSE(r.isAllOk()); // should be missing both KortTAE_Min_obl_faktor and KortTAE_Daekningsperiode
	EXPECT_EQ(2, r.getValidationResults().size());
	EXPECT_TRUE(r.hasMessages(kKortTAE_Min_obl_faktor, kProductElementRequired));
	EXPECT_TRUE(r.hasMessages(kKortTAE_Daekningsperiode, kProductElementRequired));

	ta.setValue(kKortTAE_Min_obl_faktor, "2");
	r = re.validate(ta, false);
	cout << r;
	EXPECT_FALSE(r.isAllOk());
	EXPECT_EQ(1, r.getValidationResults().size());
	EXPECT_TRUE(r.hasMessages(kKortTAE_Daekningsperiode, kProductElementRequired));

	ta.setValue(kKortTAE_Daekningsperiode, "6");
	r = re.validate(ta, false);
	cout << r;
	EXPECT_TRUE(r.isAllOk());

	ta.setValue(kKortTAE_Min_obl_faktor, "4");
	re.printConstantsInParser();
	r = re.validate(ta, false);
	cout << r;
	EXPECT_FALSE(r.isAllOk());
	EXPECT_EQ(1, r.getValidationResults().size());
	EXPECT_TRUE(r.hasMessages(kKortTAE_Min_obl_faktor, kValueNotAllowed));

}
开发者ID:jfsvak,项目名称:ruleengine,代码行数:34,代码来源:testInvaliditetsdaekning_TAE.cpp

示例2:

TEST_F(Behandlingsforsikring_KI_OSV_25_49, Behandlingsforsikring_POSITIVE) {
	RuleEngine::_printDebugAtValidation = true;
	TA ta { "15124040"}; // KonceptOid 4 - OSV
	ta.setValue(kHospitalsdaekning_MK, false);

	auto r = re.validate(ta, {kHospitalsdaekning_MK, kHospitalsdaekningFrivillig_MK, kHospitalsdaekningLeverandoer});
	EXPECT_TRUE(r.isAllOk());
//	if (!r.isAllOk())
		cout << r;

	ta.setValue(kHospitalsdaekning_MK, true);
	r = re.validate(ta, false);//{kHospitalsdaekning_MK, kHospitalsdaekningFrivillig_MK, kHospitalsdaekningLeverandoer});
	EXPECT_FALSE(r.isAllOk());
	//	if (!r.isAllOk())
		cout << r;
	EXPECT_EQ(2, r.getValidationResults().size());
	EXPECT_TRUE(r.hasMessages(kHospitalsdaekningFrivillig_MK, kProductElementRequired));
	EXPECT_TRUE(r.hasMessages(kHospitalsdaekningLeverandoer, kProductElementRequired));

	ta.setValue(kHospitalsdaekningFrivillig_MK, true);
	r = re.validate(ta, false); //{kHospitalsdaekning_MK, kHospitalsdaekningFrivillig_MK, kHospitalsdaekningLeverandoer});
	EXPECT_FALSE(r.isAllOk());
	//	if (!r.isAllOk())
		cout << r;
	EXPECT_EQ(1, r.getValidationResults().size());
	EXPECT_TRUE(r.hasMessages(kHospitalsdaekningLeverandoer, kProductElementRequired));

	ta.setValue(kHospitalsdaekningLeverandoer, re.getDefaultValue(kHospitalsdaekningLeverandoer)->stringValue());
	r = re.validate(ta, false); //{kHospitalsdaekning_MK, kHospitalsdaekningFrivillig_MK, kHospitalsdaekningLeverandoer});
	EXPECT_TRUE(r.isAllOk());
	//	if (!r.isAllOk())
		cout << r;
}
开发者ID:jfsvak,项目名称:ruleengine,代码行数:33,代码来源:testBehandlingsforsikring.cpp

示例3:

// Test kIndmeldelsesalder and getting options prior to that
TEST_F(ContributionLadder_Ingen_CONTEXT_KI_OSV_25_50, Bidragsstigningsform_Ingen_No_Hospitalsdaekning)
{
	RuleEngine::_printDebugAtValidation = true;
	TA ta { "15124040"}; // KonceptOid 4 - OSV
	ta.setValue(kPrivate_Taxed_MK, false);
	ta.setValue(kBidragsstigningsform, "Ingen");
//	ta.setValue(kUnionAgreementRelationship, kOUTSIDE);
	ta.setValue(kHospitalsdaekning_MK, false);

	// expecting complains about missing step
	auto r = re.validate(ta, false);
	EXPECT_FALSE(r.isAllOk());
//	if (r.isAllOk())
	cout << r;
	EXPECT_EQ(1, r.getValidationResults(kBidragstrappe).size());
	EXPECT_TRUE(r.hasMessages(kBidragstrappe, kProductElementRequired));

	r = re.validate(ta, (unsigned short) kBidragsstigningsform);
	EXPECT_TRUE(r.isAllOk());
//	if (r.isAllOk())
	cout << r;

	r = re.validate(ta, { kBidragsstigningsform, kBidragstrappe });
	EXPECT_TRUE(r.isAllOk());
//	if (r.isAllOk())
	cout << r;
	EXPECT_EQ(2, r.getWarnings(kBidragstrappe).size());
	EXPECT_TRUE(r.hasWarnings(kBidragstrappe, kProductElementRequired));

	//  now add one step, but let it start from 3 (!=0), and it should fail
	ta.addContributionStep( { 3, 3.4, 5.3 });
	r = re.validate(ta, false);
	EXPECT_FALSE(r.isAllOk());
//	if (r.isAllOk())
	cout << r;
	EXPECT_TRUE(r.hasMessages(kBidragstrappe, kValueNotAllowed));

	//  now remove that step, and add one that starts from 0 and no complains
	ta.removeContributionStep( { 3, 0, 0 });
	ta.addContributionStep( { 0, 3.4, 5.3 });
	r = re.validate(ta, false);
	EXPECT_TRUE(r.isAllOk());
//	if (!r.isAllOk())
	cout << r;

	//  then add one more and it should complain again, that only 1 step is allowed, when "Ingen" is selected in Bidragsstigningsform
	ta.addContributionStep( { 1, 4, 6 });
	r = re.validate(ta, false);
	EXPECT_FALSE(r.isAllOk());
//	if (r.isAllOk())
	cout << r;
	EXPECT_TRUE(r.hasMessages(kBidragstrappe, kValueNotAllowed));

	//  now remove the last step (index!=0), and everything should be fine again
	ta.removeContributionStep( { 1, 0, 0 });
	r = re.validate(ta, false);
	EXPECT_TRUE(r.isAllOk());
//	if (!r.isAllOk())
	cout << r;
}
开发者ID:jfsvak,项目名称:ruleengine,代码行数:61,代码来源:testContributionLadder_Ingen.cpp

示例4:

TEST_F(ContributionLadder_Anciennitet_CONTEXT_KI_OSV_25_50, Bidragsstigningsform_Anciennitet_3_Steps_Inkl_POSITIVE) {
	RuleEngine::_printDebugAtValidation = true;
	TA ta { "15124040"}; // KonceptOid 4 - OSV
//	ta.setValue(kUnionAgreementRelationship, kOUTSIDE);
	ta.setValue(kPrivate_Taxed_MK, false);
	ta.setValue(kBidragsstigningsform, "Anciennitet" );
	ta.setValue(kHospitalsdaekning_MK, true);
	ta.setValue(kHospitalsdaekningLeverandoer, "Codan");
	ta.setValue(kHospitalsdaekningFrivillig_MK, false);

	ta.addContributionStep( {0, 2.6, 3} );
	auto r = re.validate(ta, false);
	EXPECT_TRUE(r.isAllOk());
	cout << r;

	ta.addContributionStep( {2, 3, 4} );
	r = re.validate(ta, false);
	EXPECT_TRUE(r.isAllOk());
	cout << r;

	ta.addContributionStep( {5, 4, 3.2} );
	r = re.validate(ta, false);
	EXPECT_TRUE(r.isAllOk());
	cout << r;
}
开发者ID:jfsvak,项目名称:ruleengine,代码行数:25,代码来源:testContributionLadder_Anciennitet.cpp

示例5:

TEST_F(UnionAgreementParsing, UAIncluded_MaxAndelLinkBidragPCT) {
	KonceptInfo ki {OSV, 50, 0,
	        	{ {11, "true"}, // Parameter-Basis
	        	  {1, "true"}, // Solidarisk faellestarif
				  {15, "true"}, // FG span
				  {6, "true"} // SEB Firmapensionspulje
	        	} };
	re.initContext(ki, INCLUDED, 4);
	RuleEngine::_printDebug = true;
	RuleEngine::_printDebugAtValidation = true;

	re.getContainer().printKoncepts();
	re.getContainer().printSubkonceptConstants(18);
	re.getContainer().printUnionAgreementConstants(4);

	TA ta {"20247940"};
	ta.setValue(kMaxAndelLinkBidragPCT, 35);
	ta.setValue(kAftaleIkraftdato, 20150701);
	ta.setValue(kBidragEjFoesteTrin_MK, false);

	auto r = re.validate(ta, false);
	cout << r;
	EXPECT_FALSE(r.isAllOk());
	EXPECT_TRUE(r.hasMessages(kMaxAndelLinkBidragPCT, kValueOverLimit));

	ta.setValue(kMaxAndelLinkBidragPCT, 30);
	r = re.validate(ta, false);
	cout << r;
	EXPECT_TRUE(r.isAllOk());
}
开发者ID:jfsvak,项目名称:ruleengine,代码行数:30,代码来源:testUnionAgreementParsing.cpp

示例6:

TEST_F(TAE_RFY_KI_OSV_25_49, InsuranceCondition_2) {
	RuleEngine::_printDebugAtValidation = true;
	TA ta { "15124040" };
	ta.setValue(kInsuranceConditionVersion, "2");
	ta.setValue(kTAE_RFY, re.getDefaultValue(kTAE_RFY)->stringValue());

	auto r = re.validate(ta, false);
	EXPECT_TRUE(r.isAllOk()); // Ingen is allowed for insurance condition version 1
}
开发者ID:jfsvak,项目名称:ruleengine,代码行数:9,代码来源:testTAE_RFY.cpp

示例7:

// Test missing value on TA, DoedBlOblMax
// Allowed values:
// Expected:
//    Warnings should contain a warning say that the product element being validated is missing on the TA
TEST_F(Doedsfaldsdaekning_I_Procent_KI_OSV_25_49, DoedBlGrMin_ValidateNonExistingToken_NOT_OK) {
	TA ta { "15124040" };
	ta.setValue(kDoedReguleringskode, "Pristal");

	// set MIN value, DoedBlGrMin
	ta.setValue(kDoedBlGrMin, (long) 100000);
	RuleEngine::_printDebugAtValidation = true;

	// ... but validate MAX, DoedBlOblMax
	auto r = re.validate(ta, (unsigned short) kDoedBlOblMax);

	EXPECT_TRUE(r.isAllOk());
//	if (!r.isAllOk())
		cout << r;

	ASSERT_EQ(1, r.getWarnings(kDoedBlOblMax).size());
	EXPECT_EQ(sbx::ValidationCode::kProductElementRequired, r.getWarnings(kDoedBlOblMax).at(0).getValidationCode());
}
开发者ID:jfsvak,项目名称:ruleengine,代码行数:22,代码来源:testDodsfaldsdaekning_i_procent.cpp


注:本文中的TA::setValue方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。