当前位置: 首页>>代码示例>>C#>>正文


C# CPV.rseq方法代码示例

本文整理汇总了C#中CPV.rseq方法的典型用法代码示例。如果您正苦于以下问题:C# CPV.rseq方法的具体用法?C# CPV.rseq怎么用?C# CPV.rseq使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CPV的用法示例。


在下文中一共展示了CPV.rseq方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: RSeqWithMetaHasMeta

        public void RSeqWithMetaHasMeta()
        {
            MockRepository mocks = new MockRepository();
            IPersistentMap meta = mocks.StrictMock<IPersistentMap>();
            mocks.ReplayAll();

            CPV v = new CPV(new object[] { 4, 5, 6 });
            IObj s = (IObj)v.rseq();
            IObj obj = s.withMeta(meta);

            Expect(obj.meta(), SameAs(meta));
            mocks.VerifyAll();
        }
开发者ID:arohner,项目名称:clojure-contrib,代码行数:13,代码来源:APersistentVectorTests.cs

示例2: RseqOnPositiveCountYieldsValidSequence

        public void RseqOnPositiveCountYieldsValidSequence()
        {
            CPV v = new CPV(new object[] { 1, 2, 3 });
            ISeq s = v.rseq();

            Expect(s.first(), EqualTo(3));
            Expect(s.rest().first(), EqualTo(2));
            Expect(s.rest().rest().first(), EqualTo(1));
            Expect(s.rest().rest().rest(), Null);
        }
开发者ID:arohner,项目名称:clojure-contrib,代码行数:10,代码来源:APersistentVectorTests.cs

示例3: RSeqReduceWithStartIterates

        public void RSeqReduceWithStartIterates()
        {
            MockRepository mocks = new MockRepository();
            IFn fn = mocks.StrictMock<IFn>();
            RMExpect.Call(fn.invoke(20, 3)).Return(10);
            RMExpect.Call(fn.invoke(10, 2)).Return(5);
            RMExpect.Call(fn.invoke(5, 1)).Return(7);
            mocks.ReplayAll();

            CPV v = new CPV(new object[] { 1, 2, 3 });
            IReduce r = (IReduce)v.rseq();
            object ret = r.reduce(fn, 20);

            Expect(ret, EqualTo(7));
            mocks.VerifyAll();
        }
开发者ID:arohner,项目名称:clojure-contrib,代码行数:16,代码来源:APersistentVectorTests.cs

示例4: RseqOnCount0YieldsNull

        public void RseqOnCount0YieldsNull()
        {
            CPV v = new CPV(new object[0]);

            Expect(v.rseq(), Null);
        }
开发者ID:arohner,项目名称:clojure-contrib,代码行数:6,代码来源:APersistentVectorTests.cs

示例5: RSeqOnPositiveCountYieldsNotNull

        public void RSeqOnPositiveCountYieldsNotNull()
        {
            CPV v = new CPV(new object[] { 1, 2, 3 });

            Expect(v.rseq(), Not.Null);
        }
开发者ID:arohner,项目名称:clojure-contrib,代码行数:6,代码来源:APersistentVectorTests.cs

示例6: RSeqIndexedWorks

        public void RSeqIndexedWorks()
        {
            CPV v = new CPV(new object[] { 4, 5, 6 });
            ISeq s0 = v.rseq();
            IndexedSeq i0 = s0 as IndexedSeq;

            ISeq s1 = s0.rest();
            IndexedSeq i1 = s1 as IndexedSeq;

            Expect(i0.index(), EqualTo(0));
            Expect(i1.index(), EqualTo(1));
        }
开发者ID:arohner,项目名称:clojure-contrib,代码行数:12,代码来源:APersistentVectorTests.cs

示例7: RSeqFirstAndRestWork

        public void RSeqFirstAndRestWork()
        {
            CPV v = new CPV(new object[] { 4, 5, 6 });
            ISeq s = v.rseq();

            Expect(s.first(), EqualTo(6));
            Expect(s.rest().first(), EqualTo(5));
            Expect(s.rest().rest().first(), EqualTo(4));
            Expect(s.rest().rest().rest(), Null);
        }
开发者ID:arohner,项目名称:clojure-contrib,代码行数:10,代码来源:APersistentVectorTests.cs

示例8: RSeqCountWorks

        public void RSeqCountWorks()
        {
            CPV v = new CPV(new object[] { 4, 5, 6 });
            ISeq s = v.rseq();

            Expect(s.count(), EqualTo(3));
            Expect(s.rest().count(), EqualTo(2));
            Expect(s.rest().rest().count(), EqualTo(1));
        }
开发者ID:arohner,项目名称:clojure-contrib,代码行数:9,代码来源:APersistentVectorTests.cs

示例9: RSeqWithMetaHasMeta

        public void RSeqWithMetaHasMeta()
        {
            IPersistentMap meta = new DummyMeta();

            CPV v = new CPV(new object[] { 4, 5, 6 });
            IObj s = (IObj)v.rseq();
            IObj obj = s.withMeta(meta);

            Expect(obj.meta(), SameAs(meta));
        }
开发者ID:Niki063,项目名称:clojure-clr,代码行数:10,代码来源:APersistentVectorTests.cs

示例10: RSeqReduceWithStartIterates

        public void RSeqReduceWithStartIterates()
        {
            IFn fn = DummyFn.CreateForReduce();

            CPV v = new CPV(new object[] { 1, 2, 3 });
            IReduce r = (IReduce)v.rseq();
            object ret = r.reduce(fn, 20);

            Expect(ret, EqualTo(26));
        }
开发者ID:Niki063,项目名称:clojure-clr,代码行数:10,代码来源:APersistentVectorTests.cs


注:本文中的CPV.rseq方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。