コード例 #1
0
        public void AssocWithNumericKeyOutOfRangeLowThrowsException()
        {
            //This just checks that APersistentVector.assoc calls CPV.assocN
            CPV v = new CPV(new object[] { 4, 5, 6 });

            v.assoc(-1, 10);
        }
コード例 #2
0
        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));
        }
コード例 #3
0
        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));
        }
コード例 #4
0
        public void AssocWithNumericKeyOnePastEndAddValue()
        {
            //This just checks that APersistentVector.assoc calls CPV.assocN
            CPV         v = new CPV(new object[] { 4, 5, 6 });
            Associative a = v.assoc(3, 10);

            Expect(a.valAt(0)).To.Equal(4);
            Expect(a.valAt(1)).To.Equal(5);
            Expect(a.valAt(2)).To.Equal(6);
            Expect(a.valAt(3)).To.Equal(10);
            Expect(a.count()).To.Equal(4);
        }
コード例 #5
0
 public void AssocWithNumericKeyOutOfRangeLowThrowsException()
 {
     //This just checks that APersistentVector.assoc calls CPV.assocN
     CPV v = new CPV(new object[] { 4, 5, 6 });
     Associative a = v.assoc(-1, 10);
 }
コード例 #6
0
 public void AssocWithNonNumericKeyThrowsException()
 {
     CPV v = new CPV(new object[] { 4, 5, 6 });
     Associative a = v.assoc("a", 7);
 }
コード例 #7
0
 public void AssocWithNonNumericKeyThrowsException()
 {
     CPV         v = new CPV(new object[] { 4, 5, 6 });
     Associative a = v.assoc("a", 7);
 }