本文整理汇总了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;
}
示例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;
}