Example #1
0
        public void ShouldTruncateLongEnumeration()
        {
            var list = "this is a long string to be converted to a byte array".ToCharArray();
            var blk  = new EnumerationBlock(list, 0);

            blk.WithEnumerableCount(list.GetLength(0));
            Assert.AreEqual("{\'t\', \'h\', \'i\', \'s\', \' \', \'i\', \'s\', \' \', \'a\', \' \', \'l\', \'o\', \'n\', \'g\', \' \', \'s\', \'t\', \'r\', \'i\', \'n\', ...} (53 items)", blk.GetMessage());
        }
Example #2
0
        public void ShouldFocusOnSomePart()
        {
            var list = "this is a long string to be converted to a byte array".ToCharArray();
            var blk  = new EnumerationBlock(list, 15);

            blk.WithEnumerableCount(list.GetLength(0));
            Assert.AreEqual("[..., \'i\', \'s\', \' \', \'a\', \' \', \'l\', \'o\', \'n\', \'g\', \' \', \'s\', \'t\', \'r\', \'i\', \'n\', \'g\', \' \', \'t\', \'o\', \' \'...] (53 items)", blk.GetMessage());
        }
Example #3
0
        public void ShouldTruncateLongEnumeration()
        {
            var list = "this is a long string to be converted to a byte array".ToCharArray();
            var blk = new EnumerationBlock(list, 0);

            blk.WithEnumerableCount(list.GetLength(0));
            Assert.AreEqual("[\'t\', \'h\', \'i\', \'s\', \' \', \'i\', \'s\', \' \', \'a\', \' \', \'l\', \'o\', \'n\', \'g\', \' \', \'s\', \'t\', \'r\', \'i\', ...] (53 items)", blk.GetMessage());
        }
Example #4
0
        public void ShouldWorkForEdgeEnumerations()
        {
            var list = string.Empty.ToCharArray();
            var blk  = new EnumerationBlock <char[]>(list, 0);

            blk.WithEnumerableCount(list.GetLength(0));
            Assert.AreEqual("{} (0 item)", blk.GetMessage());
        }
Example #5
0
        public void ShoulSupportWithType()
        {
            var list = string.Empty.ToCharArray();
            var blk  = new EnumerationBlock(list, 0);

            blk.WithEnumerableCount(list.GetLength(0));
            blk.WithType();
            Assert.AreEqual("{} (0 item) of type: [char[]]", blk.GetMessage());
            blk.WithType(typeof(string));
            Assert.AreEqual("{} (0 item) of type: [string]", blk.GetMessage());
        }
Example #6
0
        public void ShoulSupportWithType()
        {
            var list = string.Empty.ToCharArray();
            var blk = new EnumerationBlock(list, 0);

            blk.WithEnumerableCount(list.GetLength(0));
            blk.WithType();
            Assert.AreEqual("[] (0 item) of type: [char[]]", blk.GetMessage());
            blk.WithType(typeof(string));
            Assert.AreEqual("[] (0 item) of type: [string]", blk.GetMessage());
        }
Example #7
0
        public void ShouldForEdgeEnumerations()
        {
            var list = string.Empty.ToCharArray();
            var blk = new EnumerationBlock(list, 0);

            blk.WithEnumerableCount(list.GetLength(0));
            Assert.AreEqual("[] (0 item)", blk.GetMessage());
            blk = new EnumerationBlock(null, 0);

            blk.WithEnumerableCount(list.GetLength(0));
            Assert.AreEqual("[null]", blk.GetMessage());
        }