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); }
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)); }
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); }
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); }
public void AssocWithNonNumericKeyThrowsException() { CPV v = new CPV(new object[] { 4, 5, 6 }); Associative a = v.assoc("a", 7); }