public void TwoFactorMainTest() { /* * Using parallel for multiple two factor tests */ Parallel.For(1, Romano.MAX_VALUE + 1, i => { var arabic = (ushort)i; var roman = Romano.Romanize(arabic); /* * Basic roman two factor tests, with strict options * IV */ Assert.Equal(arabic, Romano.Humanize(roman)); /* * Four sequential digits tests * IIII */ roman = Romano.Romanize(arabic, RomanizerOptions.ALLOW_FOUR_SEQUENTIAL_DIGITS); Assert.Equal(arabic, Romano.Humanize(roman, RomanizerOptions.ALLOW_FOUR_SEQUENTIAL_DIGITS)); /* * Multiple sequential digits tests * IIIII */ roman = Romano.Romanize(arabic, RomanizerOptions.ALLOW_MULTIPLE_SEQUENTIAL_DIGITS); Assert.Equal(arabic, Romano.Humanize(roman, RomanizerOptions.ALLOW_MULTIPLE_SEQUENTIAL_DIGITS)); }); }
public void InvalidRomanToHumanTest(string roman, Type @throw, RomanizerOptions options = RomanizerOptions.DEFAULT_STRICT) { Assert.Throws(@throw, () => Romano.Humanize(roman, options) as object); // Assert.False(Romano.IsValidRoman(roman)); }
private void HumanizeTester(string romanNumber, int expected) { int result = Romano.Humanize(romanNumber); Assert.Equal(expected, result); }
public static int Humanize(this string str) { return(Romano.Humanize(str)); }
public static int Humanize(this char str) { return(Romano.Humanize(str)); }
private void HumanizeTester(string romanNumber, int expected) { var result = Romano.Humanize(romanNumber);//, RomanizerOptions.ALLOW_ALL_SUB); Assert.Equal(expected, result); }