コード例 #1
0
        public void InsertRemove()
        {
            ConfigurationCollection collection = new ConfigurationCollection( arrayRange );
            IConfiguration config = new DefaultConfiguration( "test", "ConfigurationCollectionTest" );

            collection.Insert( 1, config );
            Assertion.Assert( collection.Contains( config ) );
            Assertion.AssertEquals( config, collection[1] );
            Assertion.AssertEquals( 4, collection.Count );

            collection.Remove( config );
            Assertion.AssertEquals( 3, collection.Count );
            Assertion.AssertEquals( false, collection.Contains( config ) );
        }
コード例 #2
0
        public void Contains()
        {
            ConfigurationCollection collection = new ConfigurationCollection( arrayRange );

            foreach ( IConfiguration config in arrayRange )
            {
                Assertion.AssertEquals( true, collection.Contains( config ) );
            }

            foreach ( IConfiguration config in collRange )
            {
                Assertion.AssertEquals( false, collection.Contains( config ) );
            }
        }