示例#1
0
        public void ArraySeq_has_correct_count_1()
        {
            object[]  array = new object[] { 1, 2, 3 };
            IArraySeq a     = ArraySeq.create(array);

            Expect(((Counted)a).count()).To.Equal(3);
        }
示例#2
0
        public void Create_on_array_and_index_creates()
        {
            object[]  array = new object[] { 1, 2, 3 };
            IArraySeq a     = ArraySeq.create(array, 0);

            Expect(a).Not.To.Be.Null();
        }
示例#3
0
        public void ArraySeq_has_correct_count_2()
        {
            object[]  array = new object[] { 1, 2, 3 };
            IArraySeq a     = ArraySeq.create(array, 1);

            Expect(((Counted)a).count(), EqualTo(2));
        }
示例#4
0
        public void Create_on_array_has_no_meta()
        {
            object[]  array = new object[] { 1, 2, 3 };
            IArraySeq a     = ArraySeq.create(array);

            Expect(a.meta()).To.Be.Null();
        }
示例#5
0
        public void Create_on_array_creates()
        {
            object[]  array = new object[] { 1, 2, 3 };
            IArraySeq a     = ArraySeq.create(array);

            Expect(a, Not.Null);
        }
示例#6
0
        public void ArraySeq_has_correct_count_1()
        {
            object[] array = new object[] { 1, 2, 3 };
            ArraySeq a     = ArraySeq.create(array);

            Expect(a.count(), EqualTo(3));
        }
示例#7
0
        public void Create_on_array_and_index_with_high_index_returns_null()
        {
            object[] array = new object[] { 1, 2, 3 };
            ArraySeq a     = ArraySeq.create(array, 10);

            Expect(a, Null);
        }
示例#8
0
        public void Create_on_array_and_index_has_no_meta()
        {
            object[] array = new object[] { 1, 2, 3 };
            ArraySeq a     = ArraySeq.create(array, 0);

            Expect(a.meta(), Null);
        }
示例#9
0
 public void Setup()
 {
     _array0 = new object[] { 1, 2, 3 };
     _array1 = new object[] { 2, 3 };
     _a0     = ArraySeq.create(_array0);
     _a1     = ArraySeq.create(_array0, 1);
 }
示例#10
0
        public void Create_on_array_and_index_creates()
        {
            object[] array = new object[] { 1, 2, 3 };
            ArraySeq a     = ArraySeq.create(array, 0);

            Expect(a, Not.Null);
        }
示例#11
0
 public void Setup()
 {
     object[] array = new object[] { 1, 2, 3 };
     _objWithNullMeta = _obj = ArraySeq.create(array, 0);
     _expectedType    = typeof(ArraySeq_object);
     _testNoChange    = false;
 }
示例#12
0
        public void ReduceWithStartIterates()
        {
            IFn fn = DummyFn.CreateForReduce();

            object[]  array = new object[] { 2, 3, 4 };
            IArraySeq a     = ArraySeq.create(array);
            object    ret   = a.reduce(fn, 20);

            Expect(ret, EqualTo(29));
        }
示例#13
0
        public void ReduceWithStartIterates()
        {
            IFn fn = DummyFn.CreateForReduce();

            object[]  array = new object[] { 2, 3, 4 };
            IArraySeq a     = ArraySeq.create(array);
            object    ret   = a.reduce(fn, 20);

            Expect(ret).To.Be.An.Instance.Of <long>();
            Expect((long)ret).To.Equal(29);
        }
示例#14
0
        public void ReduceWithNoStartIterates()
        {
            MockRepository mocks = new MockRepository();
            IFn            fn    = mocks.StrictMock <IFn>();

            RMExpect.Call(fn.invoke(2, 3)).Return(5);
            RMExpect.Call(fn.invoke(5, 4)).Return(7);
            mocks.ReplayAll();

            object[] array = new object[] { 2, 3, 4 };
            ArraySeq a     = ArraySeq.create(array);
            object   ret   = a.reduce(fn);

            Expect(ret, EqualTo(7));

            mocks.VerifyAll();
        }
示例#15
0
        public void Create_on_null_returns_null()
        {
            ArraySeq a = ArraySeq.create(null);

            Expect(a, Null);
        }
示例#16
0
 public void Setup()
 {
     object[] array = new object[] { 1, 2, 3 };
     _objWithNullMeta = _obj = ArraySeq.create(array, 0);
     _expectedType    = typeof(ArraySeq);
 }
示例#17
0
        public void Create_on_null_returns_null()
        {
            IArraySeq a = ArraySeq.create(null);

            Expect(a).To.Be.Null();
        }
示例#18
0
        public void Create_on_nothing_returns_null()
        {
            IArraySeq a = ArraySeq.create();

            Expect(a, Null);
        }