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 void RemoveIO() { TECIO ai = new TECIO(IOType.AI); ai.Quantity = 5; TECIO ao = new TECIO(IOType.AO); ao.Quantity = 5; TECIO di = new TECIO(IOType.DI); di.Quantity = 5; TECIO ioDO = new TECIO(IOType.DO); ioDO.Quantity = 5; List <TECIO> io = new List <TECIO> { ai, ao, di, ioDO }; IOCollection collection = new IOCollection(io); TECIO toRemove = new TECIO(IOType.AI); toRemove.Quantity = 2; collection.Remove(toRemove); Assert.AreEqual(3, collection.IONumber(IOType.AI)); }
public void AddType() { TECIO ai = new TECIO(IOType.AI); ai.Quantity = 5; TECIO ao = new TECIO(IOType.AO); ao.Quantity = 5; TECIO di = new TECIO(IOType.DI); di.Quantity = 5; TECIO ioDO = new TECIO(IOType.DO); ioDO.Quantity = 5; List <TECIO> io = new List <TECIO> { ai, ao, di, ioDO }; IOCollection collection = new IOCollection(io); collection.Add(IOType.AI); Assert.AreEqual(6, collection.IONumber(IOType.AI)); }
public void RemoveSpecificIOFromUniversal() { TECIO ui = new TECIO(IOType.UI); ui.Quantity = 5; List <TECIO> io = new List <TECIO> { ui }; IOCollection collection = new IOCollection(io); TECIO toRemove = new TECIO(IOType.DI); toRemove.Quantity = 2; collection.Remove(toRemove); Assert.AreEqual(3, collection.IONumber(IOType.UI)); }