コード例 #1
0
        public void AmountRangeRepository_RemoveValue()
        {
            var repo = new CountryRepository();

            var key = "SingleId";

            repo.RemoveValue(key);

            var containsKey = repo.ContainsKey(key);

            Assert.IsFalse(containsKey);
        }
コード例 #2
0
        public void CountryRepository_RemoveValue()
        {
            var repo = new CountryRepository();

            var key = "FAK";

            repo.RemoveValue(key);

            var containsKey = repo.ContainsKey(key);

            Assert.IsFalse(containsKey);
        }
コード例 #3
0
        public void CountryRepository_UpdateValue()
        {
            var repo = new CountryRepository();

            var key         = "ASM";
            var countryInfo = new CountryInfo
            {
                CountryCode  = "ASM",
                CountryName  = "Updated American Samoa",
                BaseCurrency = "USD"
            };

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

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

            Assert.IsNotNull(value);
            Assert.IsTrue(containsKey);
            Assert.AreEqual("Updated American Samoa", value.CountryName);
        }
コード例 #4
0
        public void CountryRepository_AddValue()
        {
            var repo = new CountryRepository();

            var key         = "AAA";
            var countryInfo = new CountryInfo
            {
                CountryCode  = "AAA",
                CountryName  = "Added Fake Country",
                BaseCurrency = "AAA"
            };

            repo.AddValue(key, countryInfo);

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

            Assert.IsNotNull(value);
            Assert.IsTrue(containsKey);
            Assert.AreEqual("AAA", value.CountryCode);
        }