Esempio n. 1
0
        public void ItemIdCollectionSetRange()
        {
            tlog.Debug(tag, $"ItemIdCollectionSetRange START");

            using (ItemIdCollection itemIdCollection = new ItemIdCollection(5))
            {
                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.SetRange(1, itemIdCollection);
                }
                catch (Exception e)
                {
                    tlog.Debug(tag, e.Message.ToString());
                    Assert.Fail("Caught Exception: Failed!");
                }

                testingTarget.Dispose();
            }

            tlog.Debug(tag, $"ItemIdCollectionSetRange END (OK)");
        }
Esempio n. 2
0
        public void ItemIdCollectionReverseWithParameters()
        {
            tlog.Debug(tag, $"ItemIdCollectionReverseWithParameters 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!");

            testingTarget.Capacity = 5;

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

            testingTarget.Dispose();

            tlog.Debug(tag, $"ItemIdCollectionReverseWithParameters END (OK)");
        }
Esempio n. 3
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!");
            }
        }
Esempio n. 4
0
        public void ItemIdCollectionGetRange()
        {
            tlog.Debug(tag, $"ItemIdCollectionGetRange START");

            using (ItemIdCollection itemIdCollection = new ItemIdCollection(5))
            {
                var testingTarget = new ItemIdCollection();
                Assert.IsNotNull(testingTarget, "Should be not null!");
                Assert.IsInstanceOf <ItemIdCollection>(testingTarget, "Should be an Instance of ItemIdCollection!");

                testingTarget.AddRange(itemIdCollection);

                try
                {
                    var result = testingTarget.GetRange(0, 0);
                    Assert.IsInstanceOf <ItemIdCollection>(result, "Should be an Instance of ItemIdCollection!");
                }
                catch (Exception e)
                {
                    tlog.Debug(tag, e.Message.ToString());
                    Assert.Fail("Caught Exception: Failed!");
                }

                testingTarget.Dispose();
            }

            tlog.Debug(tag, $"ItemIdCollectionGetRange END (OK)");
        }
Esempio n. 5
0
        public void ItemIdCollectionCapacitySetValueLessThanSize()
        {
            tlog.Debug(tag, $"ItemIdCollectionCapacitySetValueLessThanSize 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!");

            tlog.Debug(tag, "Count : " + testingTarget.Count);
            tlog.Debug(tag, "Capacity : " + testingTarget.Capacity.ToString());

            try
            {
                testingTarget.Capacity = 3;
            }
            catch (ArgumentOutOfRangeException e)
            {
                tlog.Debug(tag, e.Message.ToString());
                testingTarget.Dispose();
                tlog.Debug(tag, $"ItemIdCollectionCapacitySetValueLessThanSize END (OK)");
                Assert.Pass("Caught ArgumentOutOfRangeException : Passed!");
            }
        }
Esempio n. 6
0
        public void ItemIdCollectionConstructorWithCapacity()
        {
            tlog.Debug(tag, $"ItemIdCollectionConstructorWithCapacity START");

            var testingTarget = new ItemIdCollection(5);

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

            testingTarget.Dispose();
            tlog.Debug(tag, $"ItemIdCollectionConstructorWithCapacity END (OK)");
        }
Esempio n. 7
0
        public void ItemIdCollectionConstructor()
        {
            tlog.Debug(tag, $"ItemIdCollectionConstructor 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!");

            Assert.IsFalse(testingTarget.IsFixedSize);
            Assert.IsFalse(testingTarget.IsReadOnly);
            Assert.IsFalse(testingTarget.IsSynchronized);

            testingTarget.Dispose();
            tlog.Debug(tag, $"ItemIdCollectionConstructor END (OK)");
        }
Esempio n. 8
0
        public void ItemIdCollectionRemove()
        {
            tlog.Debug(tag, $"ItemIdCollectionRemove START");

            uint[] itemId = new uint[] { 1, 2, 3, 4, 3 };
            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!");

            testingTarget.Capacity = 5;

            Assert.AreEqual(true, testingTarget.Remove(3), "Should be equal!");

            testingTarget.Dispose();
            tlog.Debug(tag, $"ItemIdCollectionRemove END (OK)");
        }
Esempio n. 9
0
        public void ItemIdCollectionContains()
        {
            tlog.Debug(tag, $"ItemIdCollectionContains 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!");

            testingTarget.Capacity = 5;

            Assert.IsTrue(testingTarget.Contains(2));

            testingTarget.Dispose();
            tlog.Debug(tag, $"ItemIdCollectionContains END (OK)");
        }
Esempio n. 10
0
        public void ItemIdCollectionThis()
        {
            tlog.Debug(tag, $"ItemIdCollectionThis 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!");

            tlog.Debug(tag, testingTarget[1].ToString());

            testingTarget[2] = 5;
            tlog.Debug(tag, testingTarget[2].ToString());

            testingTarget.Dispose();
            tlog.Debug(tag, $"ItemIdCollectionThis END (OK)");
        }
Esempio n. 11
0
        public void ItemIdCollectionConstructorWithItemIdCollection()
        {
            tlog.Debug(tag, $"ItemIdCollectionConstructorWithItemIdCollection START");

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

            var itemIdCollection = new ItemIdCollection(c);

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

            var testingTarget = new ItemIdCollection(itemIdCollection);

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

            itemIdCollection.Dispose();
            testingTarget.Dispose();
            tlog.Debug(tag, $"ItemIdCollectionConstructorWithItemIdCollection END (OK)");
        }
Esempio n. 12
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!");
            }
        }