示例#1
0
        public void Array_From_Range()
        {
            var range = new Range2 <char>("A-B".Split('-').Select(x => x[0]).ToArray());
            var array = range.AsArray();

            Assert.AreEqual(2, array.Length);
            Assert.AreEqual('A', array[0]);
            Assert.AreEqual('B', array[1]);
        }
示例#2
0
        public void Range2_With_Chars()
        {
            var range = new Range2 <char>('a', 'b');

            Assert.AreEqual('a', range.MinValue);
            Assert.AreEqual('b', range.MaxValue);
            var expected = new char[] { 'a', 'b' };
            var actuals  = range.AsArray();

            for (var i = 0; i < expected.Length; i++)
            {
                Assert.AreEqual(expected[i], actuals[i]);
            }
        }