Пример #1
0
        public void ItemIdCollectionCopyToWithArrayIndex()
        {
            tlog.Debug(tag, $"ItemIdCollectionCopyToWithArrayIndex START");

            uint[] itemId = new uint[] { 1, 2, 3, 4 };
            global::System.Collections.ICollection c = itemId;

            var testingTarget = new ItemIdCollection(c);

            Assert.IsNotNull(testingTarget, "Should be not null!");
            Assert.IsInstanceOf <ItemIdCollection>(testingTarget, "Should be an Instance of ItemIdCollection!");

            uint[] array = new uint[4];

            try
            {
                testingTarget.CopyTo(array, 0);
            }
            catch (Exception e)
            {
                tlog.Debug(tag, e.Message.ToString());
                Assert.Fail("Caught Exception : Failed!");
            }

            tlog.Debug(tag, $"ItemIdCollectionCopyToWithArrayIndex END (OK)");
        }
Пример #2
0
        public void ItemIdCollectionCopyToWithCountLessThan0()
        {
            tlog.Debug(tag, $"ItemIdCollectionCopyToWithCountLessThan0 START");

            uint[] itemId = new uint[] { 1, 2, 3, 4 };
            global::System.Collections.ICollection c = itemId;

            var testingTarget = new ItemIdCollection(c);

            Assert.IsNotNull(testingTarget, "Should be not null!");
            Assert.IsInstanceOf <ItemIdCollection>(testingTarget, "Should be an Instance of ItemIdCollection!");

            try
            {
                uint[] array = new uint[4];
                testingTarget.CopyTo(0, array, 0, -1);
            }
            catch (ArgumentOutOfRangeException e)
            {
                tlog.Debug(tag, e.Message.ToString());
                testingTarget.Dispose();
                tlog.Debug(tag, $"ItemIdCollectionCopyToWithCountLessThan0 END (OK)");
                Assert.Pass("Caught ArgumentOutOfRangeException : Passed!");
            }
        }
Пример #3
0
        public void ItemIdCollectionCopyToWithNullArray()
        {
            tlog.Debug(tag, $"ItemIdCollectionCopyToWithNullArray START");

            uint[] itemId = new uint[] { 1, 2, 3, 4 };
            global::System.Collections.ICollection c = itemId;

            var testingTarget = new ItemIdCollection(c);

            Assert.IsNotNull(testingTarget, "Should be not null!");
            Assert.IsInstanceOf <ItemIdCollection>(testingTarget, "Should be an Instance of ItemIdCollection!");

            try
            {
                testingTarget.CopyTo(null);
            }
            catch (ArgumentNullException e)
            {
                tlog.Debug(tag, e.Message.ToString());
                testingTarget.Dispose();
                tlog.Debug(tag, $"ItemIdCollectionCopyToWithNullArray END (OK)");
                Assert.Fail("Caught ArgumentNullException : Failed!");
            }
        }