NotRule implements Rule { @Override public RuleResult verify(VerificationContext context) throws KSIException { return new NotRuleResult(rule, rule.verify(context)); } NotRule(Rule rule); @Override RuleResult verify(VerificationContext context); @Override String toString();  }
@Test public void testNotOkResult_NA() throws KSIException { RuleResult ruleResult = new NotRule(ruleOk).verify(context); verifyResults(ruleResult, VerificationResultCode.NA, VerificationErrorCode.GEN_02, "Not TestRule"); }
@Test public void testNotNaResult_OK() throws KSIException { RuleResult ruleResult = new NotRule(ruleNa).verify(context); verifyResults(ruleResult, VerificationResultCode.OK, null, "Not TestRule"); }
@Test public void testNotFailResult_FAIL() throws KSIException { RuleResult ruleResult = new NotRule(ruleFail).verify(context); verifyResults(ruleResult, VerificationResultCode.FAIL, VerificationErrorCode.GEN_01, "Not TestRule"); }
@Test public void testCompositeRuleNotOkResult_NA() throws KSIException { Rule rule = new NotRule(new CompositeRule(true, ruleOk, ruleFail, ruleNa)); RuleResult ruleResult = rule.verify(context); verifyResults(ruleResult, VerificationResultCode.NA, VerificationErrorCode.GEN_02, "Not TestRule,"); }
@Test public void testCompositeRuleNotNAResult_OK() throws KSIException { Rule rule = new NotRule(new CompositeRule(false, ruleNa, ruleFail, ruleOk)); RuleResult ruleResult = rule.verify(context); verifyResults(ruleResult, VerificationResultCode.OK, null, "Not TestRule,"); }
@Test public void testCompositeRuleNotFailResult_Fail() throws KSIException { Rule rule = new NotRule(new CompositeRule(false, ruleFail, ruleOk, ruleNa)); RuleResult ruleResult = rule.verify(context);; verifyResults(ruleResult, VerificationResultCode.FAIL, VerificationErrorCode.GEN_01, "Not TestRule,"); }