Example #1
0
        public void CopyTo()
        {
            var td = new TypeList <IServiceCollection> {
                typeof(ServiceCollection)
            };
            var array = new Type[1];

            Should.Throw <ArgumentNullException>(() => td.CopyTo(null, 0));
            Should.Throw <ArgumentException>(() => td.CopyTo(array, 1));
            Should.Throw <ArgumentOutOfRangeException>(() => td.CopyTo(array, -1));
            Should.NotThrow(() => td.CopyTo(array, 0));
            array[0].ShouldBe(typeof(ServiceCollection));
        }