public void TestSpecificLineCoverage(int a, int b, int c, string returnLine) { ITriangleClassification tc = new TriangleClassificationImpl(); ExecutionTracer.Reset(); ObjectiveRecorder.Reset(true); Assert.Equal(0, ExecutionTracer.GetNumberOfObjectives()); Assert.Empty(ObjectiveRecorder.AllTargets); tc.Classify(a, b, c); Assert.Contains(returnLine, ObjectiveRecorder.AllTargets); }
public void TestLineCoverage() { ITriangleClassification tc = new TriangleClassificationImpl(); ExecutionTracer.Reset(); Assert.Equal(0, ExecutionTracer.GetNumberOfObjectives()); tc.Classify(-1, 0, 0); var a = ExecutionTracer.GetNumberOfObjectives(); //at least one line should have been covered Assert.True(a > 0); }
public void TestLastLineCoverage(int a, int b, int c) { ITriangleClassification tc = new TriangleClassificationImpl(); ExecutionTracer.Reset(); ObjectiveRecorder.Reset(true); Assert.Equal(0, ExecutionTracer.GetNumberOfObjectives()); Assert.Empty(ObjectiveRecorder.AllTargets); tc.Classify(a, b, c); //assert that the last line of the method is reached Assert.Contains("Line_at_TriangleClassificationImpl_00027", ObjectiveRecorder.AllTargets); }