public void TestDictionaryFragmentSetArray() { var doc = new MutableDocument("doc1"); var array = new MutableArrayObject(); array.AddInt(0).AddInt(1).AddInt(2); doc["array"].Value = array; SaveDocument(doc, d => { d["array"][-1].Value.Should().BeNull("because that is an invalid index"); d["array"][-1].Exists.Should().BeFalse("because there is no data at the invalid index"); d["array"][0].Int.Should().Be(0, "because that is what was stored"); d["array"][1].Int.Should().Be(1, "because that is what was stored"); d["array"][2].Int.Should().Be(2, "because that is what was stored"); d["array"][3].Value.Should().BeNull("because that is an invalid index"); d["array"][3].Exists.Should().BeFalse("because there is no data at the invalid index"); }); }