public void BindingContext_RemoveCore_Invoke_Success()
        {
            var context     = new SubBindingContext();
            var source1     = new BindingSource();
            var dataSource1 = new DataSource();
            var source2     = new BindingSource();
            var dataSource2 = new DataSource();

            context.Add(dataSource1, source1.CurrencyManager);
            context.Add(dataSource2, source2.CurrencyManager);

            context.RemoveCore(dataSource1);
            Assert.Single(context);

            // Remove again.
            context.RemoveCore(dataSource1);
            Assert.Single(context);

            context.RemoveCore(dataSource2);
            Assert.Empty(context);

            // Remove again.
            context.RemoveCore(dataSource2);
            Assert.Empty(context);
        }
        public void BindingContext_RemoveCore_NullDataSource_ThrowsArgumentNullException()
        {
            var context = new SubBindingContext();

            Assert.Throws <ArgumentNullException>("dataSource", () => context.RemoveCore(null));
        }