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


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

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


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

示例1:

// 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

示例2:

TEST_F(ContributionLadder_Anciennitet_CONTEXT_KI_OSV_25_50, Bidragsstigningsform_Anciennitet_1_Step_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, false);


	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));

	ta.addContributionStep( {0, 1, 1} );
	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, kValueUnderLimit));

	ta.removeContributionStep( {0, 1, 1} );
	ta.addContributionStep( {0, 3, 3} );
	r = re.validate(ta, false);
	EXPECT_TRUE(r.isAllOk());
//	if (r.isAllOk())
		cout << r;
}
开发者ID:jfsvak,项目名称:ruleengine,代码行数:31,代码来源:testContributionLadder_Anciennitet.cpp


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