コード例 #1
0
        public void Create()
        {
            var cache = A.Fake<ICache>();
            var settings = A.Fake<IDictionary<string, string>>();

            var obj = new CustomStringProvider(cache, settings);

            Assert.IsNotNull(obj);
        }
コード例 #2
0
        public void GetTheEmtyValuesCollection()
        {
            var cache = A.Fake<ICache>();
            var settings = new Dictionary<string, string> { };

            var obj = new CustomStringProvider(cache, settings);

            var result = obj.GetAll();

            Assert.False(result.Any());
        }
コード例 #3
0
        public void Get()
        {
            var cache = A.Fake<ICache>();
            var settings = new Dictionary<string, string> { };

            var obj = new CustomStringProvider(cache, settings);

            var result = obj.GetAll();

            var i = 0;
            foreach (var t in result)
            {
                if (i++ == 9) break;
                Assert.True((string)t[0] == string.Empty);
            }
        }
コード例 #4
0
        public void Get()
        {
            var cache = A.Fake<ICache>();
            var array = new[] { "1", "2", "3" };
            var data = string.Join(Constants.ValuesSettingsSplitter.ToString(), array);
            var settings = new Dictionary<string, string> { { Keys.Values, data } };

            var obj = new CustomStringProvider(cache, settings);

            var result = obj.GetAll();

            var i = 0;
            foreach (var t in result)
            {
                if (i++ == 9) break;
                Assert.True((string)t[0] == array[(i - 1) % 3]);
            }
        }