Hi everyone,
I’m getting an error when trying to solve the “Log Analysis” exercise. The error occurs when trying to test the code. Here is the error:
LogAnalysisTests.cs(5,6): error CS0246: The type or namespace name 'FactAttribute' could not be found (are you missing a using directive or an assembly reference?)
LogAnalysisTests.cs(5,6): error CS0246: The type or namespace name 'Fact' could not be found (are you missing a using directive or an assembly reference?)
Here is my code:
public static class LogAnalysis
{
public static string SubstringAfter(this string str, string delimeter)
{
return str.Substring(str.IndexOf(delimeter),str.Length-1);
}
public static string SubstringBetween(this string str, string start, string end)
{
return str.Substring(str.IndexOf(start),str.IndexOf(end));
}
public static string Message(this string str)
{
return SubstringAfter(str, ": ");
}
public static string LogLevel(this string str)
{
return SubstringBetween(str, "[", "]");
}
}
Any idea why this happens?