public void TestRemoveDictionary() { var doc = new MutableDocument("doc1"); var profile1 = new MutableDictionaryObject(); profile1.SetString("name", "Scott Tiger"); doc.SetDictionary("profile", profile1); doc.GetDictionary("profile").ShouldBeEquivalentTo(profile1, "because that was what was inserted"); doc.Contains("profile").Should().BeTrue("because a value exists for that key"); doc.Remove("profile"); doc.GetValue("profile").Should().BeNull("beacuse the value for 'profile' was removed"); doc.Contains("profile").Should().BeFalse("because the value was removed"); profile1.SetInt("age", 20); profile1.GetString("name").Should().Be("Scott Tiger", "because the dictionary object should be unaffected"); profile1.GetInt("age").Should().Be(20, "because the dictionary should still be editable"); doc.GetValue("profile").Should() .BeNull("because changes to the dictionary should not have any affect anymore"); var savedDoc = Db.Save(doc); savedDoc.GetValue("profile").Should().BeNull("beacuse the value for 'profile' was removed"); savedDoc.Contains("profile").Should().BeFalse("because the value was removed"); }