예제 #1
0
        public void Should_containsKey_return_true_for_all_dataTypes()
        {
            var dict = new DataChangedEventDictionary(DataChangedEvent.Removed);

            dict.Add(typeof(MyClass2), typeof(RemovedEvent2));
            dict.Add(typeof(MyClass), typeof(RemovedEvent1));

            dict.ContainsKey(typeof(MyClass)).Should().BeTrue();
            dict.ContainsKey(typeof(MyClass2)).Should().BeTrue();
        }
예제 #2
0
        public void Should_Remove_not_removes_an_not_existing_value()
        {
            var dict = new DataChangedEventDictionary(DataChangedEvent.Removed);

            dict.Add(typeof(MyClass2), typeof(RemovedEvent2));
            dict.Add(typeof(MyClass), typeof(RemovedEvent1));

            dict.Remove(typeof(MyClass3)).Should().BeFalse();

            dict.ContainsKey(typeof(MyClass)).Should().BeTrue();
            dict.ContainsKey(typeof(MyClass2)).Should().BeTrue();
        }
예제 #3
0
        public void Should_containsKey_return_false_when_dataType_is_not_added()
        {
            var dict = new DataChangedEventDictionary(DataChangedEvent.Removed);

            dict.Add(typeof(MyClass2), typeof(RemovedEvent2));

            dict.ContainsKey(typeof(MyClass)).Should().BeFalse();
        }