示例#1
0
        public void RemoveAt_Invoke_Success()
        {
            var collection = new BindingsCollection();
            var binding    = new Binding(null, new object(), "member");

            collection.Add(binding);

            collection.RemoveAt(0);
            Assert.Empty(collection);
        }
        public void Bindings_RemoveAt_Success()
        {
            var manager = new PropertyManager();
            BindingsCollection collection = manager.Bindings;
            var binding = new Binding(null, new object(), "member");

            collection.Add(binding);
            Assert.Same(binding, Assert.Single(collection));
            Assert.Same(manager, binding.BindingManagerBase);

            collection.RemoveAt(0);
            Assert.Empty(collection);
            Assert.Null(binding.BindingManagerBase);
        }