示例#1
0
        public void CurrencyRepository_RemoveValue()
        {
            var repo = new CurrencyRepository();

            var key = "LVL";

            repo.RemoveValue(key);

            var containsKey = repo.ContainsKey(key);

            Assert.IsFalse(containsKey);
        }
示例#2
0
        public void CurrencyRepository_UpdateValue()
        {
            var repo = new CurrencyRepository();

            var key      = "FJD";
            var currency = new CurrencyInfo
            {
                CurrencyCode = "FJD",
                CurrencyName = "UPDATED FIJI DOLLAR"
            };

            repo.UpdateValue(key, currency);
            var containsKey = repo.ContainsKey(key);

            var value = repo.GetValue <CurrencyInfo>(key);

            Assert.IsNotNull(value);
            Assert.IsTrue(containsKey);
            Assert.AreEqual("UPDATED FIJI DOLLAR", value.CurrencyName);
        }
示例#3
0
        public void CurrencyRepository_AddValue()
        {
            var repo = new CurrencyRepository();

            var key      = "FAK";
            var currency = new CurrencyInfo
            {
                CurrencyCode = "FAK",
                CurrencyName = "Fake Dollar"
            };

            repo.AddValue(key, currency);

            var value       = repo.GetValue <CurrencyInfo>(key);
            var containsKey = repo.ContainsKey(key);

            Assert.IsNotNull(value);
            Assert.IsTrue(containsKey);
            Assert.AreEqual("FAK", value.CurrencyCode);
        }