本文整理汇总了C#中SourceRepository.GetCodeCoverageStringTextSource方法的典型用法代码示例。如果您正苦于以下问题:C# SourceRepository.GetCodeCoverageStringTextSource方法的具体用法?C# SourceRepository.GetCodeCoverageStringTextSource怎么用?C# SourceRepository.GetCodeCoverageStringTextSource使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SourceRepository
的用法示例。
在下文中一共展示了SourceRepository.GetCodeCoverageStringTextSource方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TransformSequences_RemoveFalsePositiveUnvisited
private static void TransformSequences_RemoveFalsePositiveUnvisited (IEnumerable<Method> methods, SourceRepository sourceRepository, DateTime moduleTime)
{
var sequencePointsSet = new HashSet<SequencePoint>(new SequencePointComparer());
var toRemoveMethodSequencePoint = new List<Tuple<Method, SequencePoint>>();
// Initialise sequencePointsSet
TransformSequences_RemoveFalsePositiveUnvisited(methods, sequencePointsSet);
// Check generated methods
foreach (var method in methods
.Where (m => m.FileRefUniqueId != 0
&& m.SequencePoints.Length != 0
&& m.IsGenerated)) {
// Select duplicate and false-positive unvisited sequence points
// (Sequence point duplicated by generated method and left unvisited)
foreach (var sp in method.SequencePoints
.Where (sp => sp.FileId == method.FileRefUniqueId
&& sp.VisitCount == 0) ) {
if (sequencePointsSet.Contains(sp)) {
// Unvisited duplicate found, add to remove list
toRemoveMethodSequencePoint.Add (new Tuple<Method, SequencePoint>(method, sp));
}
}
// Get method source if availabile
var source = sourceRepository.GetCodeCoverageStringTextSource(method.FileRefUniqueId);
if (source != null && !source.IsChanged(moduleTime)) {
TransformSequences_RemoveFalsePositiveUnvisited (method, source, toRemoveMethodSequencePoint);
}
}
// Remove selected SequencePoints
foreach (var tuple in toRemoveMethodSequencePoint) {
tuple.Item1.SequencePoints = tuple.Item1.SequencePoints.Where(sp => sp != tuple.Item2).ToArray();
}
}
示例2: TransformSequences_RemoveCompilerGeneratedBranches
private static void TransformSequences_RemoveCompilerGeneratedBranches (IEnumerable<Method> methods, SourceRepository sourceRepository, DateTime moduleTime)
{
foreach (var method in methods
.Where (m => m.FileRefUniqueId != 0
&& m.SequencePoints.Length != 0)) {
// Get method source if availabile
var source = sourceRepository.GetCodeCoverageStringTextSource(method.FileRefUniqueId);
if (source != null) {
if (source.IsChanged (moduleTime)) {
("Source file is modified: " + source.FilePath).InformUser();
return;
}
if (!TransformSequences_RemoveCompilerGeneratedBranches (method, source)) {
return; // empty sequence found -> source.IsChanged (failed access to file-times)
}
}
}
}