I've created a method in C# that extends the string datatype, creating an additional overload to the Split function so that a text qualifier can be defined. Example string data is defined as "field 1","field 2","filed 3"
string[] splitData = data.Split(',','"')
The extension works fine. I can access the method once I reference and use the namespace. However there is an issue in the method I'm trying to debug, but the debugger won't step into the extension method.
Extension Code
namespace Extensions
{
public static class StringExtension
{
public static string[] Split(this string s, char delimiter, char qualifier)
{
// Method does work
}
}
}
Code in nUnit Test
string testString = "\"Field 1\",\"Field 2\",\"Field 3\"";
int expectedCount = 3;
// Do Test.
string[] result = testString.Split(',','"');
Assert.AreEqual(expectedCount, result.Length);
I can't step into testString.Split(',','"'). It returns a result and intellisense shows the extension method. The debugger just steps over it, as it would for the built in Split method.
Any ideas??