public void PutAll() { IDBObject start = new DBObject() { { "a", 7 }, { "d", 4 } }; Assert.AreEqual(7, start["a"]); Assert.AreEqual(4, start["d"]); start.PutAll(new DBObject() { { "a", 1 }, { "b", 2 }, { "c", 3 } }); Assert.AreEqual(1, start["a"]); //Overwrite Assert.AreEqual(2, start["b"]); //Add Assert.AreEqual(3, start["c"]); //Add Assert.AreEqual(4, start["d"]); //Left alone }
public void PutAllTest() { IDBObject start = new DBObject() { { "a", 7 }, { "d", 4 } }; start.PutAll(new DBObject() { { "a", 1 }, { "b", 2 }, { "c", 3 } }); start["a"].Should().Be(1, "put should have overwritten a"); start["b"].Should().Be(2, "put should have added b"); start["c"].Should().Be(3, "put should have added c"); start["d"].Should().Be(4, "d was not in the put"); }