public void Constructor_EmptyDictionaryAsDictionaryArgument_ShouldSetItemsPropertyToEmptyEnumerable() { var dictionary = CreateReadOnlyDictionary <string, object>(); var proxy = new ReadOnlyDictionaryDebuggerProxy <string, object>(dictionary); EnumerableAssert.IsEmpty(proxy.Items); }
public void Constructor_ValueAsDictionaryArgument_ShouldSetItemsProperty() { var expectations = Expectations.GetMetadata(); foreach (var e in expectations) { var proxy = new ReadOnlyDictionaryDebuggerProxy <string, object>(CreateReadOnlyDictionary(e)); EnumerableAssert.AreEqual(e, proxy.Items); } }
public void Items_ShouldNotCacheUnderlyingItems() { var dictionary = new Dictionary <string, object>(); dictionary.Add("Name", "Value"); var proxy = new ReadOnlyDictionaryDebuggerProxy <string, object>(CreateReadOnlyDictionary(dictionary)); EnumerableAssert.AreEqual(dictionary, proxy.Items); dictionary.Add("AnotherName", "Value"); EnumerableAssert.AreEqual(dictionary, proxy.Items); dictionary.Add("AndAnotherName", "Value"); EnumerableAssert.AreEqual(dictionary, proxy.Items); }