public void CannotCopyToViaGenericCollectionWithTooSmallArray() { ICollection <KeyValuePair <string, object> > obj = new JsonObject(); obj.Add(new KeyValuePair <string, object>("foo", "bar")); obj.CopyTo(new KeyValuePair <string, object> [1], 1); }
public void CopyToViaGenericCollection() { ICollection <KeyValuePair <string, object> > obj = new JsonObject(); KeyValuePair <string, object> first = new KeyValuePair <string, object>("first", 123); obj.Add(first); KeyValuePair <string, object> second = new KeyValuePair <string, object>("second", 456); obj.Add(second); KeyValuePair <string, object>[] pairs = new KeyValuePair <string, object> [2]; obj.CopyTo(pairs, 0); Assert.AreEqual(first, pairs[0]); Assert.AreEqual(second, pairs[1]); }
public void CopyToViaGenericCollection() { ICollection<KeyValuePair<string, object>> obj = new JsonObject(); KeyValuePair<string, object> first = new KeyValuePair<string, object>("first", 123); obj.Add(first); KeyValuePair<string, object> second = new KeyValuePair<string, object>("second", 456); obj.Add(second); KeyValuePair<string, object>[] pairs = new KeyValuePair<string, object>[2]; obj.CopyTo(pairs, 0); Assert.AreEqual(first, pairs[0]); Assert.AreEqual(second, pairs[1]); }
public void CannotCopyToViaGenericCollectionWithTooSmallArray() { ICollection<KeyValuePair<string, object>> obj = new JsonObject(); obj.Add(new KeyValuePair<string, object>("foo", "bar")); obj.CopyTo(new KeyValuePair<string, object>[1], 1); }
public void CannotCopyToViaGenericCollectionWithNullArray() { ICollection<KeyValuePair<string, object>> obj = new JsonObject(); obj.CopyTo(null, 0); }
public void CannotCopyToViaGenericCollectionWithNegativeArrayIndex() { ICollection<KeyValuePair<string, object>> obj = new JsonObject(); obj.CopyTo(new KeyValuePair<string, object>[0], -1); }
public void CannotCopyToViaGenericCollectionWithNegativeArrayIndex() { ICollection <KeyValuePair <string, object> > obj = new JsonObject(); obj.CopyTo(new KeyValuePair <string, object> [0], -1); }
public void CannotCopyToViaGenericCollectionWithNullArray() { ICollection <KeyValuePair <string, object> > obj = new JsonObject(); obj.CopyTo(null, 0); }