コード例 #1
0
        public void FeatureCollectionCopyToTest()
        {
            FeatureCollection collection = new FeatureCollection(this.identifier, this.mockAttributes, this.mockFeatures);

            IFeature[] array = new IFeature[collection.Count];
            collection.CopyTo(array, 0);

            foreach (IFeature feature in this.mockFeatures)
            {
                array.Contains(feature).ShouldBeTrue();
            }

            Should.Throw <ArgumentNullException>(() => collection.CopyTo(null, 0));
            Should.Throw <ArgumentOutOfRangeException>(() => collection.CopyTo(array, -1));
            Should.Throw <ArgumentException>(() => collection.CopyTo(array, 1));
        }