public void TestGetValueFromNewEmptyDictionary() { DictionaryObject dict = new MutableDictionaryObject(); dict.GetInt("key").Should().Be(0, "because that is the default value"); dict.GetLong("key").Should().Be(0L, "because that is the default value"); dict.GetDouble("key").Should().Be(0.0, "because that is the default value"); dict.GetBoolean("key").Should().Be(false, "because that is the default value"); dict.GetDate("key").Should().Be(DateTimeOffset.MinValue, "because that is the default value"); dict.GetBlob("key").Should().BeNull("because that is the default value"); dict.GetValue("key").Should().BeNull("because that is the default value"); dict.GetString("key").Should().BeNull("because that is the default value"); dict.GetDictionary("key").Should().BeNull("because that is the default value"); dict.GetArray("key").Should().BeNull("because that is the default value"); dict.ToDictionary().Should().BeEmpty("because the dictionary is empty"); var doc = new MutableDocument("doc1"); doc.SetDictionary("dict", dict); Db.Save(doc); var gotDoc = Db.GetDocument("doc1"); dict = gotDoc.GetDictionary("dict"); dict.GetInt("key").Should().Be(0, "because that is the default value"); dict.GetLong("key").Should().Be(0L, "because that is the default value"); dict.GetDouble("key").Should().Be(0.0, "because that is the default value"); dict.GetBoolean("key").Should().Be(false, "because that is the default value"); dict.GetDate("key").Should().Be(DateTimeOffset.MinValue, "because that is the default value"); dict.GetBlob("key").Should().BeNull("because that is the default value"); dict.GetValue("key").Should().BeNull("because that is the default value"); dict.GetString("key").Should().BeNull("because that is the default value"); dict.GetDictionary("key").Should().BeNull("because that is the default value"); dict.GetArray("key").Should().BeNull("because that is the default value"); dict.ToDictionary().Should().BeEmpty("because the dictionary is empty"); }