public RomanNumber(int num)
        {
            var arabic = new ArabicNumber(num);
            var romanConvertibleCollection = new RomanConvertibleCollection(arabic);
            var result = romanConvertibleCollection.ToString();

            value = 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);
        }
        private static RomanSymbol[] ComposeSymbolsFromNum(ArabicNumber evaluatingArabic)
        {
            var symbolList = RomanSymbols.GetAll()
                             .Reverse().ToArray();

            List <RomanSymbol> result = new List <RomanSymbol>();
            var arabic = evaluatingArabic;
            var count  = 0;

            while (arabic.IsGreaterThan(ArabicNumber.Zero) && count < symbolList.Length)
            {
                var currSymbol = symbolList[count];
                var part       = ExtractSymbolPart(arabic, currSymbol);
                if (part.Any())
                {
                    result.AddRange(part);
                    arabic = evaluatingArabic.Substract(result.ToArray());
                }
                count++;
            }

            return(result.ToArray());
        }
 public RomanConvertibleCollection(ArabicNumber arabic)
 {
     Items = ComposeSymbolsFromNum(arabic);
 }
 internal bool IsGreaterThan(ArabicNumber other) =>
 this.Value > other.Value;