How challenges are graded
The Solution contract, output capture, and reading a test verdict.
The graded contract
Every challenge in this course gives you a starter file and grades specific public members of Solution. Early on that's static methods and a static void program() whose printed output is captured and checked:
public class Solution
{
public static void program()
{
Console.WriteLine("exactly this");
}
}
A hidden test runs your method, captures everything it prints, and compares. Output is compared exactly โ punctuation, capitalization, spacing. "Print the sum" means the number, not The sum is: 7, unless the task says so. Precision here is practice for real logs, APIs, and file formats.
Reading a verdict
Each test reports:
- pass โ your code did exactly what the test asked.
- fail with a message โ read the message: it says what was expected vs what happened (
expected 7, got 10). - compile error โ your code never ran; fix the compiler output first.
Three debugging habits to build now:
- Read the message before changing code. Guess-editing burns attempts.
- Reproduce mentally: trace the failing case by hand.
- Change one thing at a time โ otherwise you can't know what helped.
What "done" means here
A challenge passes when all hidden tests pass. Tests include the edges the prompt calls out โ empty input, zero, negatives. Passing the happy case is the start of the work, not the end.
The next lesson-by-lesson practice is deliberate: imitate (copy the pattern), then modify, then build from a blank file. That progression is how syntax becomes skill.