本文整理汇总了C#中CPV类的典型用法代码示例。如果您正苦于以下问题:C# CPV类的具体用法?C# CPV怎么用?C# CPV使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
CPV类属于命名空间,在下文中一共展示了CPV类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: AssocWithNumericKeyInRangeChangesValue
public void AssocWithNumericKeyInRangeChangesValue()
{
//This just checks that APersistentVector.assoc calls CPV.assocN
CPV v = new CPV(new object[] { 4, 5, 6 });
Associative a = v.assoc(1, 10);
Expect(a.valAt(0), EqualTo(4));
Expect(a.valAt(1), EqualTo(10));
Expect(a.valAt(2), EqualTo(6));
Expect(a.count(), EqualTo(3));
}
开发者ID:arohner,项目名称:clojure-contrib,代码行数:11,代码来源:APersistentVectorTests.cs
示例2: EqualsOnNonPersistentVectorIsFalse
public void EqualsOnNonPersistentVectorIsFalse()
{
CPV v1 = new CPV(new object[] { 1, 2, 3 });
Expect(v1.equiv(7), False);
}
开发者ID:arohner,项目名称:clojure-contrib,代码行数:6,代码来源:APersistentVectorTests.cs
示例3: ContainsKeyOnIndexInRangeIsTrue
public void ContainsKeyOnIndexInRangeIsTrue()
{
CPV v = new CPV(new object[] { 4, 5, 6 });
Expect(v.containsKey(1.2));
}
开发者ID:arohner,项目名称:clojure-contrib,代码行数:6,代码来源:APersistentVectorTests.cs
示例4: ValAtOnNonNumericReturnsDefault
public void ValAtOnNonNumericReturnsDefault()
{
CPV v = new CPV(new object[] { 4, 5, 6 });
object val1 = v.valAt("a");
object val2 = v.valAt("a", "abc");
Expect(val1, Null);
Expect(val2, EqualTo("abc"));
}
开发者ID:arohner,项目名称:clojure-contrib,代码行数:10,代码来源:APersistentVectorTests.cs
示例5: ValAtOnIndexInRangeReturnsEntry
public void ValAtOnIndexInRangeReturnsEntry()
{
CPV v = new CPV(new object[] { 4, 5, 6 });
object val1 = v.valAt(1);
object val2 = v.valAt(1, "abc");
Expect(val1, EqualTo(5));
Expect(val2, EqualTo(5));
}
开发者ID:arohner,项目名称:clojure-contrib,代码行数:10,代码来源:APersistentVectorTests.cs
示例6: 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
示例7: 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
示例8: HashCodeRepeats
public void HashCodeRepeats()
{
CPV v = new CPV(new object[] { 1, 2, 3 });
Expect(v.GetHashCode(), EqualTo(v.GetHashCode()));
}
开发者ID:arohner,项目名称:clojure-contrib,代码行数:6,代码来源:APersistentVectorTests.cs
示例9: InvokeCallsNth
public void InvokeCallsNth()
{
CPV v = new CPV(new object[] { 5, 6, 7 });
Expect(v.invoke(0),EqualTo(5));
Expect(v.invoke(1),EqualTo(6));
Expect(v.invoke(2),EqualTo(7));
Expect(v.invoke("1"), EqualTo(6));
Expect(v.invoke(1.0), EqualTo(6));
Expect(v.invoke(1.2), EqualTo(6));
Expect(v.invoke(1.8), EqualTo(6)); // Rounds or not-- should it?
Expect(v.invoke(1.4M), EqualTo(6));
}
开发者ID:arohner,项目名称:clojure-contrib,代码行数:13,代码来源:APersistentVectorTests.cs
示例10: Explicit_IPersistentCollection_cons_works
public void Explicit_IPersistentCollection_cons_works()
{
CPV v = new CPV(new object[] { 1, 2 });
IPersistentCollection c = v as IPersistentCollection;
Expect(c, Not.Null);
IPersistentCollection c2 = c.cons(3);
Expect(c2.count(), EqualTo(3));
ISeq s2 = c2.seq();
Expect(s2.first(), EqualTo(1));
Expect(s2.rest().first(), EqualTo(2));
Expect(s2.rest().rest().first(), EqualTo(3));
Expect(s2.rest().rest().rest(), Null);
}
开发者ID:arohner,项目名称:clojure-contrib,代码行数:17,代码来源:APersistentVectorTests.cs
示例11: HashCodeDependsOnItems
public void HashCodeDependsOnItems()
{
CPV v1 = new CPV(new object[] { 1, 2, 3 });
CPV v2 = new CPV(new object[] { 1, 2, 4 });
Expect(v1.GetHashCode(), Not.EqualTo(v2.GetHashCode()));
}
开发者ID:arohner,项目名称:clojure-contrib,代码行数:7,代码来源:APersistentVectorTests.cs
示例12: EqualsOnSimilarISeqWorks
public void EqualsOnSimilarISeqWorks()
{
CPV v1 = new CPV(new object[] { 'a', 'b', 'c' });
StringSeq s1 = StringSeq.create("abc");
Expect(v1.equiv(s1));
}
开发者ID:arohner,项目名称:clojure-contrib,代码行数:7,代码来源:APersistentVectorTests.cs
示例13: EqualsOnPersistentVectorWithSameItemsIsTrue
public void EqualsOnPersistentVectorWithSameItemsIsTrue()
{
CPV v1 = new CPV(new object[] { 1, 2, 3 });
CPV v2 = new CPV(new object[] { 1, 2, 3 });
CPV v3 = new CPV(new object[] { 1 });
CPV v4 = new CPV(new object[] { 1 });
CPV v5 = new CPV(new object[] { });
CPV v6 = new CPV(new object[] { });
Expect(v1.equiv(v2));
Expect(v3.equiv(v4));
Expect(v5.equiv(v6));
}
开发者ID:arohner,项目名称:clojure-contrib,代码行数:13,代码来源:APersistentVectorTests.cs
示例14: EqualsOnPersistentVectorWithDifferentItemsIsFalse
public void EqualsOnPersistentVectorWithDifferentItemsIsFalse()
{
CPV v1 = new CPV(new object[] { 1, 2, 3 });
CPV v2 = new CPV(new object[] { 1, 2, 4 });
CPV v3 = new CPV(new object[] { 1, 2 });
CPV v4 = new CPV(new object[] { 1, 2, 3, 4 });
Expect(v1.equiv(v2), False);
Expect(v1.equiv(v3), False);
Expect(v1.equiv(v4), False);
}
开发者ID:arohner,项目名称:clojure-contrib,代码行数:11,代码来源:APersistentVectorTests.cs
示例15: 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
示例16: MetaCtorHasMeta
public void MetaCtorHasMeta()
{
MockRepository mocks = new MockRepository();
IPersistentMap meta = mocks.StrictMock<IPersistentMap>();
mocks.ReplayAll();
CPV v = new CPV(meta,new object[] { 1, 2, 3 });
Expect(v.meta(), SameAs(meta));
mocks.VerifyAll();
}
开发者ID:arohner,项目名称:clojure-contrib,代码行数:11,代码来源:APersistentVectorTests.cs
示例17: SeqOnCount0YieldsNull
public void SeqOnCount0YieldsNull()
{
CPV v = new CPV(new object[0]);
Expect(v.seq(), Null);
}
开发者ID:arohner,项目名称:clojure-contrib,代码行数:6,代码来源:APersistentVectorTests.cs
示例18: NoMetaCtorHasNoMeta
public void NoMetaCtorHasNoMeta()
{
CPV v = new CPV(new object[] { 1, 2, 3 });
Expect(v.meta(),Null);
}
开发者ID:arohner,项目名称:clojure-contrib,代码行数:6,代码来源:APersistentVectorTests.cs
示例19: 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
示例20: PeekOnCount0ReturnsNull
public void PeekOnCount0ReturnsNull()
{
CPV v = new CPV(new object[] {});
Expect(v.peek(), Null);
}
开发者ID:arohner,项目名称:clojure-contrib,代码行数:6,代码来源:APersistentVectorTests.cs
注:本文中的CPV类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论