Beispiel #1
0
 protected override void DoExecute()
 {
     while (true)
     {
         Console.Write("\nInsert unicode text (Ctrl+C to exit): ");
         WL(UnicodeSymbol.FromSymbol(RL()).TokenizedCodePoints.Replace(" ", " | "));
     }
 }
        public void FromTokenizedCodePoints_Empty_EmptySymbol()
        {
            UnicodeSymbol empty = UnicodeSymbol.FromTokenizedCodePoints(string.Empty);

            Assert.That(empty.Symbol, Is.Empty);
            Assert.That(empty.CodePoints, Is.Empty);
            Assert.That(empty.TokenizedCodePoints, Is.Empty);
        }
Beispiel #3
0
 public CurrencyInfo Build()
 {
     return(new CurrencyInfo(Code, EnglishName, NativeName,
                             UnicodeSymbol.FromSymbol(Symbol).TokenizedCodePoints,
                             SignificantDecimalDigits, DecimalSeparator, GroupSeparator,
                             NMoneys.Support.GroupSizes.FromSizes(GroupSizes).TokenizedSizes,
                             PositivePattern, NegativePattern, Obsolete,
                             string.IsNullOrEmpty(EntityName) ? null : new CharacterReference(EntityName)));
 }
        public void FromSymbol_TranslatedCodePoints(
            string symbol,
            string tokenizedCodePoints,
            int[] codePoints)
        {
            UnicodeSymbol subject = UnicodeSymbol.FromSymbol(symbol);

            Assert.That(subject.Symbol, Is.EqualTo(symbol));
            Assert.That(subject.TokenizedCodePoints, Is.EqualTo(tokenizedCodePoints));
            Assert.That(subject.CodePoints, Is.EqualTo(codePoints));
        }
        public void FromTokenizedCodePoints_ValidTokenizedPoints_TranslatedToSymbolAndCodePoints(
            string tokenizedCodePoints,
            string symbol,
            int[] codePoints)
        {
            UnicodeSymbol subject = UnicodeSymbol.FromTokenizedCodePoints(tokenizedCodePoints);

            Assert.That(subject.TokenizedCodePoints, Is.EqualTo(tokenizedCodePoints));
            Assert.That(subject.Symbol, Is.EqualTo(symbol));
            Assert.That(subject.CodePoints, Is.EqualTo(codePoints));
        }
        private CultureCurrencyInfo(CultureInfo ci, RegionInfo ri)
        {
            Culture = ci;
            var nf = ci.NumberFormat;

            Info = new CurrencyInfo(
                Enumeration.Parse <CurrencyIsoCode>(ri.ISOCurrencySymbol),
                ri.CurrencyEnglishName,
                ri.CurrencyNativeName,
                UnicodeSymbol.FromSymbol(ri.CurrencySymbol).TokenizedCodePoints,
                nf.CurrencyDecimalDigits,
                nf.CurrencyDecimalSeparator,
                nf.CurrencyGroupSeparator,
                GroupSizes.FromSizes(nf.CurrencyGroupSizes).TokenizedSizes,
                nf.CurrencyPositivePattern,
                nf.CurrencyNegativePattern,
                false,
                CharacterReference.Empty);
        }
Beispiel #7
0
 public void Run()
 {
     WriteLine(UnicodeSymbol.FromSymbol(Text).TokenizedCodePoints.Replace(" ", " | "));
 }
 public void FromSymbol_NotASymbol_Exception(string notASymbol, Type expectedException)
 {
     Assert.That(() => UnicodeSymbol.FromSymbol(notASymbol), Throws.InstanceOf(expectedException));
 }
 public void FromTokenizedCodePoints_NotACodePointChain_Exception(string notAChainOfCodePoints, Type expectedException)
 {
     Assert.That(() => UnicodeSymbol.FromTokenizedCodePoints(notAChainOfCodePoints), Throws.InstanceOf(expectedException));
 }
Beispiel #10
0
 public void FromTokenizedCodePoints_WrongTokenizer_Exception(string wrongTokenizer)
 {
     Assert.That(() => UnicodeSymbol.FromTokenizedCodePoints(wrongTokenizer), Throws.InstanceOf <FormatException>());
 }