public void RemoveSpecificListFromUnivsersal()
        {
            List <TECIO> io = new List <TECIO>
            {
                new TECIO(IOType.AI),
                new TECIO(IOType.AO),
                new TECIO(IOType.DI),
                new TECIO(IOType.DO)
            };
            List <TECIO> otherIO = new List <TECIO>
            {
                new TECIO(IOType.UI),
                new TECIO(IOType.UI),
                new TECIO(IOType.UI),
                new TECIO(IOType.UI),
                new TECIO(IOType.UO),
                new TECIO(IOType.UO),
                new TECIO(IOType.UO),
                new TECIO(IOType.UO)
            };
            IOCollection firstColletion   = new IOCollection(io);
            IOCollection secondCollection = new IOCollection(otherIO);

            IOCollection resultCollection = new IOCollection(secondCollection);

            resultCollection.Remove(firstColletion.ToList());

            Assert.IsTrue(resultCollection.Contains(IOType.UI));
            Assert.AreEqual(2, resultCollection.IONumber(IOType.UI));

            Assert.IsTrue(resultCollection.Contains(IOType.UO));
            Assert.AreEqual(2, resultCollection.IONumber(IOType.UO));
        }
        public void AddList()
        {
            List <TECIO> io = new List <TECIO>
            {
                new TECIO(IOType.AI),
                new TECIO(IOType.AO),
                new TECIO(IOType.DI),
                new TECIO(IOType.DO)
            };
            IOCollection firstColletion   = new IOCollection(io);
            IOCollection secondCollection = new IOCollection(io);

            IOCollection resultCollection = new IOCollection();

            resultCollection.Add(firstColletion.ToList());
            resultCollection.Add(secondCollection.ToList());

            Assert.IsTrue(resultCollection.Contains(IOType.AI));
            Assert.AreEqual(2, resultCollection.IONumber(IOType.AI));

            Assert.IsTrue(resultCollection.Contains(IOType.AO));
            Assert.AreEqual(2, resultCollection.IONumber(IOType.AO));

            Assert.IsTrue(resultCollection.Contains(IOType.DI));
            Assert.AreEqual(2, resultCollection.IONumber(IOType.DI));

            Assert.IsTrue(resultCollection.Contains(IOType.DO));
            Assert.AreEqual(2, resultCollection.IONumber(IOType.DO));
        }
        public static int IONumber(this IOCollection collection, IOType type)
        {
            int ioNum = 0;

            foreach (TECIO io in collection.ToList())
            {
                if (io.Type == type)
                {
                    ioNum += io.Quantity;
                }
            }
            return(ioNum);
        }