Logs, Logs, Logs! Question

I am looking at the Logs, Logs, Logs! exercise, and I’m unsure how to proceed. The tests appear to be referencing a LogLevel enum that is defined in the logslogslogs.cs file, producing a compile error.

    [Fact]
    [Task(1)]
    public void Parse_trace()
    {
        Assert.Equal(LogLevel.Trace, LogLine.ParseLogLevel("[TRC]: Line 84 - Console.WriteLine('Hello World');"));
    }

Is the intention here that I would update the logslogslogstests.cs file in some way? I assume that the tests should run as written.

I think I’m missing something here. Any clarity? Thanks!

You should not update the tests. If the tests reference an enum and the enum doesn’t exist, can you add the enum so the tests pass?

I unlocked Community Solutions to see how other have done this, which I wouldn’t ordinarily have done. I see how it can be made to work using an approach to scoping I wouldn’t normally use, but I get it now. Thanks.

The need to create the enum is referenced in the task instructions. It’s most likely not provided from the start so students get practice defining an enum. Is there something that might need to be clarified then in the instructions? It’s a somewhat common meta-practice on Exercism tracks that the test suite imports a data enumeration from the student’s code to then help test the student’s code. I’ve seen that a few times with the Yacht exercise in particular.

The thing that threw me off was the requirement to declare an enum outside a class or namespace, where I would usually put such a definition. That’s all - just my brain blocking me from thinking outside that guideline.

1 Like