Example #1
0
        public void ConversionToBaseSet()
        {
            CurrencySet <Iso4217.Currency> convSet = _set;

            var allCur = convSet.AllCurencies;
            var cur    = convSet.TryParse("EUR");
        }
Example #2
0
        public void TryParseNumCodeFail()
        {
            var set = new CurrencySet(new[] { _xa, _xb, _xc });

            ICurrency c;

            Assert.IsFalse(set.TryParse("???", out c));
        }
Example #3
0
        public void TryParseCharCode()
        {
            var set = new CurrencySet(new[] { _xa, _xb, _xc });

            ICurrency c;

            Assert.IsTrue(set.TryParse("XA", out c));
            Assert.AreEqual("XA", c.CharCode);
        }
Example #4
0
        public void ParseCharFalse()
        {
            var set = new CurrencySet(new[] { _xa, _xb, _xc });

            Assert.Throws <NotSupportedException>(() =>
            {
                set.Parse("???");
            });
        }
Example #5
0
        public void Create()
        {
            ICurrencySet set = new CurrencySet(new[] { _xa, _xb, _xc });

            Assert.AreEqual(3, set.AllCurencies.Count);

            Assert.IsTrue(set.Contain(_xa));
            Assert.IsTrue(set.Contain(_xb));
            Assert.IsTrue(set.Contain(_xc));
        }
Example #6
0
        public void NotContainCode()
        {
            var set = new CurrencySet(new[] { _xa, _xb, _xc });

            Assert.IsFalse(set.Contain("???"));
        }
Example #7
0
        public void NotContainCurrency()
        {
            var set = new CurrencySet(new[] { _xa, _xb, _xc });

            Assert.IsFalse(set.Contain(new FakeCurrency()));
        }
Example #8
0
        public void ParseCharCode()
        {
            var set = new CurrencySet(new[] { _xa, _xb, _xc });

            Assert.AreEqual("XA", set.Parse("XA").CharCode);
        }
Example #9
0
        public void Contains()
        {
            var set = new CurrencySet(new[] { _xa, _xb, _xc });

            Assert.IsTrue(set.Contain(_xa.CharCode));
        }