本文整理汇总了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();
}
示例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);
}
示例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();
}
示例4: RseqOnCount0YieldsNull
public void RseqOnCount0YieldsNull()
{
CPV v = new CPV(new object[0]);
Expect(v.rseq(), Null);
}
示例5: RSeqOnPositiveCountYieldsNotNull
public void RSeqOnPositiveCountYieldsNotNull()
{
CPV v = new CPV(new object[] { 1, 2, 3 });
Expect(v.rseq(), Not.Null);
}
示例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));
}
示例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);
}
示例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));
}
示例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));
}
示例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));
}