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


C# CPV.seq方法代码示例

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


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

示例1: SeqWithMetaHasMeta

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

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

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

示例2: SeqOnPositiveCountYieldsValidSequence

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

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

示例3: SeqReduceWithStartIterates

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

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

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

示例4: SeqOnCount0YieldsNull

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

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

示例5: SeqOnPositiveCountYieldsNotNull

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

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

示例6: SeqIndexedWorks

        public void SeqIndexedWorks()
        {
            CPV v = new CPV(new object[] { 4, 5, 6 });
            ISeq s0 = v.seq();
            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: SeqFirstAndRestWork

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

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

示例8: SeqCountWorks

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

            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: SeqWithMetaHasMeta

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

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

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

示例10: SeqReduceWithStartIterates

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

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

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


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