timschlechter / SpecResults

Get better feedback from your SpecFlow testsuite
http://specflowreporting.azurewebsites.net/
MIT License
23 stars 18 forks source link

Table Arguments Failing #4

Closed Stewartarmbrecht closed 10 years ago

Stewartarmbrecht commented 10 years ago

My gherkin statement that had a table argument was causing the reporter to fail. I was able to resolve the failure by changing SpecFlow.Reporting.Extensions file:

    internal static string ReplaceFirst(this string s, string find, string replace)
    {
        var first = s.IndexOf(find);
        return s.Substring(0, first) + replace + s.Substring(first + find.Length);
    }

To

    internal static string ReplaceFirst(this string s, string find, string replace)
    {
        var first = s.IndexOf(find);
  if (first > -1)
    return s.Substring(0, first) + replace + s.Substring(first + find.Length);
  else 
    return s;
    }
timschlechter commented 10 years ago

Fixed this in 3d8e37169f675793cd3b0933a2526f78f545ecb7 I will publish a new version later on this day which contains this fix

timschlechter commented 10 years ago

0.4.6 contains the fix for this issue

Stewartarmbrecht commented 10 years ago

This is fixed by my tests.