public static string GetFileScopedLabel(this StepInstance stepInstance) { var position = stepInstance as ISourceFilePosition; var simpleLabel = stepInstance.GetLabel(); if (position == null) { return(simpleLabel); } return(String.Format("{0} ({1}, line {2})", simpleLabel, position.SourceFile, position.FilePosition.Line)); }