public void ToStringReturnsViolationAsLine() { var expectedResult = "Line 666: [SA666] You cannot do this."; var violation = new Violation("SA666", "You cannot do this.", 666); Assert.AreEqual(expectedResult, violation.ToString()); }
public void AddViolationToFile(string fileName, Violation violation) { if (this.violations.ContainsKey(fileName)) { IList<Violation> currentViolationList; if (this.violations.TryGetValue(fileName, out currentViolationList)) { currentViolationList.Add(violation); } } else { this.violations.Add(fileName, new List<Violation> { violation }); } }
public void AddViolationToFile(string fileName, Violation violation) { if (this.violations.ContainsKey(fileName)) { IList <Violation> currentViolationList; if (this.violations.TryGetValue(fileName, out currentViolationList)) { currentViolationList.Add(violation); } } else { this.violations.Add(fileName, new List <Violation> { violation }); } }
private void RenderViolation(Violation violation) { this.outputWriter.WriteColoredLine(violation.ToString(), ConsoleColor.DarkRed); }