Example #1
0
        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));
            });
        }
Example #2
0
        public void ToRomanTest(ushort number, string expect)
        {
            var result = Romano.Romanize(number);

            Assert.Equal(expect, result);
        }
Example #3
0
 public static string Romanizer(this decimal val)
 {
     return(Romano.Romanize(val));
 }
Example #4
0
 public static string Romanizer(this double val)
 {
     return(Romano.Romanize(val));
 }
Example #5
0
 public static string Romanizer(this float val)
 {
     return(Romano.Romanize(val));
 }
Example #6
0
 public static string Romanizer(this ulong val)
 {
     return(Romano.Romanize(val));
 }
Example #7
0
 public static string Romanizer(this ushort val)
 {
     return(Romano.Romanize(val));
 }