--
You received this message because you are subscribed to the Google Groups "altnetisrael" group.
To unsubscribe from this group and stop receiving emails from it, send an email to altnetisrael...@googlegroups.com.
To post to this group, send email to altnet...@googlegroups.com.
Visit this group at http://groups.google.com/group/altnetisrael.
For more options, visit https://groups.google.com/d/optout.
Couldn't be there today, but I hope your presentation chucked a wobbly :)
private static string GenerateShouldMessage(object actual, object expected)
{
var environment = GetStackFrameForOriginatingTestMethod();
var codePart = "The provided expression";
if (environment.DeterminedOriginatingFrame)
{
var possibleCodeLines = File.ReadAllLines(environment.FileName)
.Skip(environment.LineNumber).ToArray();
var codeLines = possibleCodeLines.DelimitWith("\n");
var shouldMethodIndex = codeLines.IndexOf(environment.ShouldMethod);
codePart = shouldMethodIndex > -1 ?
codeLines.Substring(0, shouldMethodIndex - 1).Trim() :
possibleCodeLines[0];
}
return CreateActualVsExpectedMessage(actual, expected, environment, codePart);
}