public void ShouldCalculateNumberOfLinesForFooFirst() { var method = _assemblySearcher.FindMethod("First"); var lineCalculator = new NumberOfLinesCalculator(_MaxLines); var loc = lineCalculator.Calculate(method); Assert.That(loc.Result, Is.InRange(1, 4)); }
public void ShouldDetermineCyclomicComplexityForFooFirst() { var method = _assemblySearcher.FindMethod("First"); var cyclomicComplextityCalculator = new ILCyclomicComplextityCalculator(_MaxCC); var cc = cyclomicComplextityCalculator.Calculate(method); Assert.That(cc.Result, Is.EqualTo(1)); }
public void ShouldReturnNullForInvalidMethod() { var methodFinder = new AssemblySearcher(_assembly); var method = methodFinder.FindMethod("NonExisting"); Assert.That(method, Is.Null); }
public void ShouldLoadValidMethod() { var methodFinder = new AssemblySearcher(_assembly); var method = methodFinder.FindMethod("First"); Assert.That(method.Name, Is.EqualTo("First")); }
public void ShouldReturnAllInstructionsWithSequencePoints() { var method = _methodFinder.FindMethod("First"); var instructions = method.Body.Instructions.WithSequencePoint(); foreach (var instruction in instructions) { Assert.That(instruction.SequencePoint, Is.Not.Null); } }