Tests/Tools.cs
/// <summary>
/// A helper to write to the debug console from tests
/// </summary>
/// <param name="input">The input to the test</param>
/// <param name="parsed">The result of the parsed dice expression</param>
/// <param name="result">The result of the dice roll</param>
/// <param name="expected">What the test expected to generate</param>
A helper to write to the debug console from tests
A helper to write to the debug console from tests
public static void Write(string input, DiceExpression? parsed, DiceResult? result = null, object? expected = null)
		{
			Debug.WriteLine($"Input: {input}");
			if (parsed is not null)
			{
				Debug.WriteLine($"Parsed: {input}");
			}
			else
			{
				Debug.WriteLine("Parsed: <null>");
			}
			Debug.WriteLineIf(result is not null, $"Result: {result}");
			Debug.WriteLineIf(expected is not null, $"Expected: {expected}");
		}
public static void Write ( string input , DiceExpression ? parsed , DiceResult ? result = null , object ? expected = null ) { Debug . WriteLine ( $" Input:  { input } " ) ; if ( parsed is not null ) { Debug . WriteLine ( $" Parsed:  { input } " ) ; } else { Debug . WriteLine ( " " ) ; } Debug . WriteLineIf ( result is not null , $" Result:  { result } " ) ; Debug . WriteLineIf ( expected is not null , $" Expected:  { expected } " ) ; }
A helper to write to the debug console from tests
A helper to write to the debug console from tests
input
string
The input to the test
The input to the test
parsed
DiceExpression?
The result of the parsed dice expression
The result of the parsed dice expression
result
DiceResult?
The result of the dice roll
The result of the dice roll
expected
object?
None