public void ValidateInputFormat_DataDriven(string guess, int guessLength, int digitMinVal, int digitMaxVal, bool expectedResult) { output.WriteLine($"Testing: guess:{guess}, guessLength:{guessLength}, digitMinVal:{digitMinVal}, digitMaxVal:{digitMaxVal}, expectedResult:{expectedResult}"); IGameDefinition definition = new GameDefinition(1, guessLength, digitMinVal, digitMaxVal); var result = definition.ValidateInputFormat(guess, out string message); // If success we expect no message, if fail, we expect a message var messageAsExpected = result ? (string.IsNullOrEmpty(message)) : (message.Length > 0); Assert.Equal(expectedResult, result); Assert.True(messageAsExpected, "Message output not as expected"); }