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


C# lang.MapEntry类代码示例

本文整理汇总了C#中clojure.lang.MapEntry的典型用法代码示例。如果您正苦于以下问题:C# MapEntry类的具体用法?C# MapEntry怎么用?C# MapEntry使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


MapEntry类属于clojure.lang命名空间,在下文中一共展示了MapEntry类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: HashCodeFalseOnDifferentValues

        public void HashCodeFalseOnDifferentValues()
        {
            MapEntry me = new MapEntry(1, "abc");
            PersistentVector v = PersistentVector.create(1, "abcd");

            Expect(me.GetHashCode(), Not.EqualTo(v.GetHashCode()));
        }
开发者ID:TerabyteX,项目名称:clojure-clr,代码行数:7,代码来源:MapEntryTests.cs

示例2: EqualsWorksFalseOnDifferentValues

        public void EqualsWorksFalseOnDifferentValues()
        {
            MapEntry me = new MapEntry(1, "abc");
            PersistentVector v = PersistentVector.create(1, "abcd");

            Expect(me.Equals(v),False);
        }
开发者ID:TerabyteX,项目名称:clojure-clr,代码行数:7,代码来源:MapEntryTests.cs

示例3: HashCodeSameAsPersistentVector

        public void HashCodeSameAsPersistentVector()
        {
            MapEntry me = new MapEntry(1, "abc");
            PersistentVector v = PersistentVector.create(1, "abc");

            Expect(me.GetHashCode(), EqualTo(v.GetHashCode()));
        }
开发者ID:TerabyteX,项目名称:clojure-clr,代码行数:7,代码来源:MapEntryTests.cs

示例4: CtorCreatesEntryWithProperKeyVal

        public void CtorCreatesEntryWithProperKeyVal()
        {
            MapEntry me = new MapEntry(1, "abc");

            Expect(me.key(), EqualTo(1));
            Expect(me.val(), EqualTo("abc"));
        }
开发者ID:TerabyteX,项目名称:clojure-clr,代码行数:7,代码来源:MapEntryTests.cs

示例5: EqualsWorksOnPersistentVector

        public void EqualsWorksOnPersistentVector()
        {
            MapEntry me = new MapEntry(1, "abc");
            PersistentVector v = PersistentVector.create(1, "abc");

            Expect(me.Equals(v));
        }
开发者ID:TerabyteX,项目名称:clojure-clr,代码行数:7,代码来源:MapEntryTests.cs

示例6: ConsWorks

        public void ConsWorks()
        {
            MapEntry me = new MapEntry(1, "abc");
            IPersistentVector v1 = me.cons(2);

            Expect(me.count(), EqualTo(2));
            Expect(me.key(), EqualTo(1));
            Expect(me.val(), EqualTo("abc"));

            Expect(v1.count(), EqualTo(3));
            Expect(v1.nth(0), EqualTo(1));
            Expect(v1.nth(1), EqualTo("abc"));
            Expect(v1.nth(2), EqualTo(2));
        }
开发者ID:kmartin,项目名称:clojure-contrib,代码行数:14,代码来源:MapEntryTests.cs

示例7: AssocNInRangeModifies

        public void AssocNInRangeModifies()
        {
            MapEntry me = new MapEntry(1, "abc");
            IPersistentVector v1 = me.assocN(0, 2);
            IPersistentVector v2 = me.assocN(1, "def");
            IPersistentVector v3 = me.assocN(2, "ghi");

            Expect(me.count(), EqualTo(2));
            Expect(me.key(), EqualTo(1));
            Expect(me.val(), EqualTo("abc"));

            Expect(v1.count(), EqualTo(2));
            Expect(v1.nth(0), EqualTo(2));
            Expect(v1.nth(1), EqualTo("abc"));

            Expect(v2.count(), EqualTo(2));
            Expect(v2.nth(0), EqualTo(1));
            Expect(v2.nth(1), EqualTo("def"));

            Expect(v3.count(), EqualTo(3));
            Expect(v3.nth(0), EqualTo(1));
            Expect(v3.nth(1), EqualTo("abc"));
            Expect(v3.nth(2), EqualTo("ghi"));
        }
开发者ID:kmartin,项目名称:clojure-contrib,代码行数:24,代码来源:MapEntryTests.cs

示例8: EmptyReutrnsNull

        public void EmptyReutrnsNull()
        {
            MapEntry me = new MapEntry(1, "abc");

            Expect(me.empty(), Null);
        }
开发者ID:TerabyteX,项目名称:clojure-clr,代码行数:6,代码来源:MapEntryTests.cs

示例9: SeqReturnsASeq

        public void SeqReturnsASeq()
        {
            MapEntry me = new MapEntry(1, "abc");
            ISeq s = me.seq();

            Expect(s.count(), EqualTo(2));
            Expect(s.first(), EqualTo(1));
            Expect(s.next().first(), EqualTo("abc"));
            Expect(s.next().next(), Null);
        }
开发者ID:TerabyteX,项目名称:clojure-clr,代码行数:10,代码来源:MapEntryTests.cs

示例10: CountIs2

 public void CountIs2()
 {
     MapEntry me = new MapEntry(1, "abc");
     Expect(me.count(), EqualTo(2));
 }
开发者ID:TerabyteX,项目名称:clojure-clr,代码行数:5,代码来源:MapEntryTests.cs

示例11: PeekReturnsVal

        public void PeekReturnsVal()
        {
            MapEntry me = new MapEntry(1, "abc");

            Expect(me.peek(), EqualTo("abc"));
            Expect(me.count(), EqualTo(2));
            Expect(me.key(), EqualTo(1));
            Expect(me.val(), EqualTo("abc"));
        }
开发者ID:TerabyteX,项目名称:clojure-clr,代码行数:9,代码来源:MapEntryTests.cs

示例12: EntryAtOnExistingKeyWorks

        public void EntryAtOnExistingKeyWorks()
        {
            MapEntry me = new MapEntry(1, "abc");
            IMapEntry me1 = me.entryAt(0);
            IMapEntry me2 = me.entryAt(1);

            Expect(me1.key(), EqualTo(0));
            Expect(me1.val(), EqualTo(1));
            Expect(me2.key(), EqualTo(1));
            Expect(me2.val(), EqualTo("abc"));
        }
开发者ID:TerabyteX,项目名称:clojure-clr,代码行数:11,代码来源:MapEntryTests.cs

示例13: ContainsKeyOutOfRangeIsFalse

        public void ContainsKeyOutOfRangeIsFalse()
        {
            MapEntry me = new MapEntry(1, "abc");

            Expect(me.containsKey(-4),False);
            Expect(me.containsKey(4), False);
        }
开发者ID:TerabyteX,项目名称:clojure-clr,代码行数:7,代码来源:MapEntryTests.cs

示例14: ContainsKeyOnExistingKeyWorks

        public void ContainsKeyOnExistingKeyWorks()
        {
            MapEntry me = new MapEntry(1, "abc");

            Expect(me.containsKey(0));
            Expect(me.containsKey(1));
        }
开发者ID:TerabyteX,项目名称:clojure-clr,代码行数:7,代码来源:MapEntryTests.cs

示例15: AssocNOutOfRangeHighThrows

 public void AssocNOutOfRangeHighThrows()
 {
     MapEntry me = new MapEntry(1, "abc");
     me.assocN(4, 2);
 }
开发者ID:TerabyteX,项目名称:clojure-clr,代码行数:5,代码来源:MapEntryTests.cs


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