public void ToDictionary_returns_propery_keys_and_values_if_object_is_not_null() { object id = 123; object name = "Customer Name"; var obj = new { Id = id, Name = name }; var result = obj.ToDictionary(); Assert.AreEqual(id, result["Id"]); Assert.AreEqual(name, result["Name"]); }