public virtual void TestAddTwice()
 {
     ClientConfigurationItemUnitTestCase.DummyConfigurationItem item = new ClientConfigurationItemUnitTestCase.DummyConfigurationItem
                                                                           (_applied);
     _config.AddConfigurationItem(item);
     _config.AddConfigurationItem(item);
     _config.ApplyConfigurationItems(new MockClient());
     Assert.AreEqual(1, item.PrepareCount());
     AssertListsAreEqual(Arrays.AsList(new ClientConfigurationItemUnitTestCase.DummyConfigurationItem
                                       [] { item }), _applied);
 }
		public virtual void TestAddTwice()
		{
			ClientConfigurationItemUnitTestCase.DummyConfigurationItem item = new ClientConfigurationItemUnitTestCase.DummyConfigurationItem
				(_applied);
			_config.AddConfigurationItem(item);
			_config.AddConfigurationItem(item);
			_config.ApplyConfigurationItems(new MockClient());
			Assert.AreEqual(1, item.PrepareCount());
			AssertListsAreEqual(Arrays.AsList(new ClientConfigurationItemUnitTestCase.DummyConfigurationItem
				[] { item }), _applied);
		}
        public virtual void TestPrepareApply()
        {
            IList items = Arrays.AsList(new ClientConfigurationItemUnitTestCase.DummyConfigurationItem
                                        [] { new ClientConfigurationItemUnitTestCase.DummyConfigurationItem(_applied), new
                                             ClientConfigurationItemUnitTestCase.DummyConfigurationItem(_applied) });

            for (IEnumerator itemIter = items.GetEnumerator(); itemIter.MoveNext();)
            {
                ClientConfigurationItemUnitTestCase.DummyConfigurationItem item = ((ClientConfigurationItemUnitTestCase.DummyConfigurationItem
                                                                                    )itemIter.Current);
                _config.AddConfigurationItem(item);
                Assert.AreEqual(1, item.PrepareCount());
            }
            Assert.AreEqual(0, _applied.Count);
            _config.ApplyConfigurationItems(new MockClient());
            AssertListsAreEqual(items, _applied);
            for (IEnumerator itemIter = items.GetEnumerator(); itemIter.MoveNext();)
            {
                ClientConfigurationItemUnitTestCase.DummyConfigurationItem item = ((ClientConfigurationItemUnitTestCase.DummyConfigurationItem
                                                                                    )itemIter.Current);
                Assert.AreEqual(1, item.PrepareCount());
            }
        }