private static void VerifySpans( DynamicAnalysisDataReader reader, DynamicAnalysisMethod methodData, string[] sourceLines, params SpanResult[] expected ) { ArrayBuilder <string> expectedSpanSpellings = ArrayBuilder <string> .GetInstance( expected.Length ); foreach (SpanResult expectedSpanResult in expected) { Assert.True( sourceLines[expectedSpanResult.StartLine] .Substring(expectedSpanResult.StartColumn) .StartsWith(expectedSpanResult.TextStart) ); expectedSpanSpellings.Add( string.Format( "({0},{1})-({2},{3})", expectedSpanResult.StartLine, expectedSpanResult.StartColumn, expectedSpanResult.EndLine, expectedSpanResult.EndColumn ) ); } VerifySpans(reader, methodData, expectedSpanSpellings.ToArrayAndFree()); }
private static void VerifySpans( DynamicAnalysisDataReader reader, DynamicAnalysisMethod methodData, params string[] expected ) { AssertEx.Equal( expected, reader .GetSpans(methodData.Blob) .Select(s => $"({s.StartLine},{s.StartColumn})-({s.EndLine},{s.EndColumn})") ); }
private static void VerifySpans(DynamicAnalysisDataReader reader, DynamicAnalysisMethod methodData, params string[] expected) { AssertEx.Equal(expected, reader.GetSpans(methodData.Blob).Select(s => $"({s.StartLine},{s.StartColumn})-({s.EndLine},{s.EndColumn})")); }
private static void VerifySpans(DynamicAnalysisDataReader reader, DynamicAnalysisMethod methodData, string[] sourceLines, params SpanResult[] expected) { ArrayBuilder<string> expectedSpanSpellings = ArrayBuilder<string>.GetInstance(expected.Length); foreach (SpanResult expectedSpanResult in expected) { Assert.True(sourceLines[expectedSpanResult.StartLine].Substring(expectedSpanResult.StartColumn).StartsWith(expectedSpanResult.TextStart)); expectedSpanSpellings.Add(string.Format("({0},{1})-({2},{3})", expectedSpanResult.StartLine, expectedSpanResult.StartColumn, expectedSpanResult.EndLine, expectedSpanResult.EndColumn)); } VerifySpans(reader, methodData, expectedSpanSpellings.ToArrayAndFree()); }