コード例 #1
0
 @Test
 public void testCreateViolationWithNoSourceInfoButLocationForMethod() throws Exception {
   violationMaker.registerRuleType(aRule, "Method");
   Violation violation = violationMaker.createViolation();
   assertThat(violation.getResource(), is(aFileMoney));
   assertNull(violation.getLineId());
 }
コード例 #2
0
 @Test
 public void testCreateViolationWithNoSourceInfoButLocationForInnerType() throws Exception {
   violationMaker.registerRuleType(aRule, "Type");
   violationMaker.setCurrentLocation("Example.Core.IMoney/InnerClass");
   Violation violation = violationMaker.createViolation();
   assertThat(violation.getResource(), is(aFileIMoney));
   assertNull(violation.getLineId());
 }
コード例 #3
0
 @Test
 public void testCreateViolationOnAssembly() throws Exception {
   violationMaker.registerRuleType(aRule, "Assembly");
   Violation violation = violationMaker.createViolation();
   assertThat(violation.getResource(), is((Resource) project));
   assertThat(violation.getSeverity(), is(RulePriority.BLOCKER));
   assertNull(violation.getLineId());
 }
コード例 #4
0
 @Test
 public void testCreateViolationWithNoResourceFound() throws Exception {
   violationMaker.registerRuleType(aRule, "Assembly");
   violationMaker.setCurrentTargetName("Foo)");
   violationMaker.setCurrentLocation("Foo");
   Violation violation = violationMaker.createViolation();
   assertThat(violation.getResource(), is((Resource) project));
   assertNull(violation.getLineId());
 }