I have an interface with a method like this:
public string GetImageSrc(string input);
The implementation of this is below:
public string GetImageSrc(string input)
{
if (input.ContainsImage())
{
DoWork();
}
return input;
}
My string extension for ConatinsImage is:
public static bool ContainsImage(this string input)
{
if (!string.IsNullOrEmpty(input))
{
return input.Contains("img");
}
return false;
}
DoWork is a private method in the class. I am writing Unit Tests for the class - I am passing null to the method and doing an assert that null is returned. However is there a way I can Assert the invocation of the DoWork private method is None for a null input?