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


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

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


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

示例1:

TEST_F(ContributionLadder_Ingen_CONTEXT_KI_OSV_25_50, Bidragsstigningsform_Ingen_PrivateTaxedMK_Gage_NEGATIVE)
{
	RuleEngine::_printDebugAtValidation = true;
	TA ta { "15124040"}; // KonceptOid 4 - OSV
	ta.setValue(kAftaleIkraftdato, 20150701);
//	ta.setValue(kUnionAgreementRelationship, kOUTSIDE);
	ta.setValue(kBidragEjFoesteTrin_MK, false);
	ta.setValue(kBidragsstigningsform, "Ingen");
	ta.setValue(kHospitalsdaekning_MK, false);
	ta.setValue(kHospitalsdaekningFrivillig_MK, false);
	ta.setValue(kTAEReguleringskode, "Gage");
	ta.setValue(kDoedReguleringskode, "Gage");
	ta.setValue(kPrivate_Taxed_MK, true);
	ta.setValue(kPrivate_Taxed_Reguleringskode, "Gage");
	ta.setValue(kPrivate_Taxed_SA_Administrated_MK, true);
	ta.setValue(kPrivate_Premium_pct, 3);
	ta.setValue(kPrivate_Premium_BL, 40000);

	auto r = re.validate(ta, false);
	EXPECT_FALSE(r.isAllOk());
	EXPECT_TRUE(r.hasMessages(kPrivate_Premium_pct, kValueUnderLimit));
	EXPECT_TRUE(r.hasMessages(kPrivate_Premium_BL, kProductElementNotAllowed));
	cout << r;

	ta.setValue(kPrivate_Premium_pct, 5);
	ta.remove(kPrivate_Premium_BL);
	r = re.validate(ta, true);
	EXPECT_FALSE(r.hasMessages(kPrivate_Premium_pct, kValueUnderLimit));
	EXPECT_FALSE(r.hasMessages(kPrivate_Premium_BL, kProductElementNotAllowed));
	cout << r;
}
开发者ID:jfsvak,项目名称:ruleengine,代码行数:31,代码来源:testContributionLadder_Ingen.cpp

示例2:

TEST_F(Invaliditetsdaekning_KI_OSV_25_49, Invaliditetsdaekning_SoliMax_TAEDaekningstype) {
	RuleEngine::_printDebugAtValidation = true;
	TA ta { "15124040" };
	ta.setValue(kTAESoliMax, "Tegningsmaks");

	auto r = re.validate(ta, false);
//	if (!r.isAllOk())
		cout << r;
	EXPECT_TRUE(r.isAllOk()); //

	ta.setValue(kTAESoliMax, "Obligatorisk maks");
	r = re.validate(ta, false);
	cout << r;
	EXPECT_FALSE(r.isAllOk());
	EXPECT_EQ(1, r.getValidationResults().size());
	EXPECT_TRUE(r.hasMessages(kTAEDaekningstype, kProductElementRequired));

	ta.setValue(kTAEDaekningstype, re.getDefaultValue(kTAEDaekningstype)->stringValue());
	r = re.validate(ta, false);
	cout << r;
	EXPECT_TRUE(r.isAllOk());

	ta.setValue(kTAESoliMax, "Tegningsmaks");
	r = re.validate(ta, false);
	cout << r;
	EXPECT_EQ(1, r.getValidationResults().size());
	EXPECT_TRUE(r.hasMessages(kTAEDaekningstype, kProductElementNotAllowed));

	r = re.validate(ta, false);
	cout << r;

	ta.remove(kTAEDaekningstype);
	ta.setValue(kTAESoliMax, "Ingen");
	r = re.validate(ta, false);
	cout << r;
	EXPECT_EQ(1, r.getValidationResults().size());
	EXPECT_TRUE(r.hasMessages(kTAEDaekningstype, kProductElementRequired));
}
开发者ID:jfsvak,项目名称:ruleengine,代码行数:38,代码来源:testInvaliditetsdaekning_TAE.cpp

示例3:


//.........这里部分代码省略.........
	//
	//
	// ****** Udlobsalder
	//
	ta.setValue(kUdlobsalder_Pension, (long) 67);
	r = re.validate(ta, full);
	EXPECT_TRUE(r.isAllOk());
	if (!r.isAllOk())
		cout << r;


	//
	// ******* Fravalg af risikodaekning
	//
	ta.setValue(kFravalgRisiko_MK, true);
	r = re.validate(ta, full);
	cout << r;

	EXPECT_FALSE(r.isAllOk());
	EXPECT_EQ(1, r.getValidationResults(kFravalgRisikoAlder).size());
	EXPECT_EQ(1, r.getValidationResults(kFravalgRisiko_MK).size());
	EXPECT_EQ(sbx::ValidationCode::kProductElementRequired, r.getValidationResults(kFravalgRisikoAlder).at(0).getValidationCode());
	EXPECT_EQ(sbx::ValidationCode::kValueNotAllowed, r.getValidationResults(kFravalgRisiko_MK).at(0).getValidationCode());
	ta.setValue(kFravalgRisikoAlder, (long) 45);

	// now age is set, so all should be ok
	r = re.validate(ta, full);
	EXPECT_FALSE(r.isAllOk());
	cout << r;
	EXPECT_EQ(1, r.getValidationResults(kFravalgRisiko_MK).size());
	EXPECT_EQ(sbx::ValidationCode::kValueNotAllowed, r.getValidationResults(kFravalgRisiko_MK).at(0).getValidationCode());

	ta.setValue(kFravalgRisiko_MK, false);
	ta.remove(kFravalgRisikoAlder);
	r = re.validate(ta, full);
	cout << r;
	EXPECT_TRUE(r.isAllOk());

	//
	// ****** Opsparingsprodukter
	//
	ta.setValue(kStandardProduct, "Traditionel_MK");
	ta.setValue(kTraditionel_MK, false);
	//    expecting to fail as the standardprodukt hasn't been set on the ta
	r = re.validate(ta, full);
	EXPECT_FALSE(r.isAllOk());
	if (r.isAllOk()) cout << r;

	ta.setValue(kTraditionel_MK, true);
	ta.setValue(kLink_MK, true);
	ta.setValue(kMarkedspension_MK, true);
	ta.setValue(kTidspensionMedGaranti_MK, true);
	ta.setValue(kTidspensionUdenGaranti_MK, true);

	//    now savings products has been set, so everything should be fine
	r = re.validate(ta, full);
	EXPECT_TRUE(r.isAllOk());
	if (!r.isAllOk()) cout << r;

	ta.setValue(kUdbetalingsform, re.getDefaultValue(kUdbetalingsform)->stringValue());
	r = re.validate(ta, full);
	EXPECT_TRUE(r.isAllOk());
	if (!r.isAllOk()) cout << r;

	ta.setValue(kUdbetalingsperiode, re.getDefaultValue(kUdbetalingsperiode)->longValue());
	r = re.validate(ta, full);
开发者ID:jfsvak,项目名称:ruleengine,代码行数:67,代码来源:testIncremental_TA_Validation.cpp


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