Example #1
0
        public void CreateRepetition()
        {
            var arabicFive = new ArabicNumber(5);
            var result     = RomanSymbolRepetition.CanCreateRepetition(RomanSymbols.V, arabicFive);

            Assert.True(result);
        }
Example #2
0
        public void NotCreateEmptyRepetition()
        {
            var arabicThree = new ArabicNumber(3);
            var result      = RomanSymbolRepetition.CanCreateRepetition(RomanSymbols.V, arabicThree);

            Assert.False(result);
        }
        private static IEnumerable <RomanSymbol> ExtractSymbolPart(ArabicNumber arabic, RomanSymbol romanSymbol)
        {
            if (SpecialRomanSymbols.ContainsEquivalent(arabic))
            {
                return(SpecialRomanSymbols.GetItemsFromEquivalent(arabic));
            }
            var repetition = RomanSymbolRepetition.FromOcurrancesOfSymbol(romanSymbol, arabic);

            return(repetition.Equals(RomanSymbolRepetition.Empty)
                ? new RomanSymbol[0]
                : repetition.Items);
        }