public class RomanNumeralService
public string Convert(int number)
public class RomanNumeralServiceTests
private readonly RomanNumeralService _service = new RomanNumeralService();
public void Convert_ValidNumber_ReturnsCorrectRomanNumeral()
Assert.Equal("I", _service.Convert(1));
public static void Main()
RunAllTests(typeof(RomanNumeralServiceTests));
Console.WriteLine($"Test execution failed: {ex.Message}");
public static void RunAllTests(Type testClassType)
var testClassInstance = Activator.CreateInstance(testClassType);
var testMethods = testClassType.GetMethods(BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly)
.Where(m => m.ReturnType == typeof(void) && m.GetParameters().Length == 0);
foreach (var method in testMethods)
method.Invoke(testClassInstance, null);
Console.WriteLine($"Test Passed: {method.Name}");
catch (TargetInvocationException ex) when (ex.InnerException != null)
Console.WriteLine($"Test Failed: {method.Name} - {ex.InnerException.Message}");