Ejemplo n.º 1
0
        public void RemoveDuplicatesFromSecondList_Removes_Duplicates_From_Second_List_Using_Node_Headers(int testItemId)
        {
            var item = _data.TestItems[testItemId];

            var reader = new VnaAdjListReader();
            // build test lists, Section and index do not matter
            var list1 = new List<HeaderField>();
            var list2 = new List<HeaderField>();

            for (int i = 0; i < item.NodeDataHeadersExpected.Length; i++)
                list1.Add(new HeaderField(item.NodeDataHeadersExpected[i], VnaFileSection.None, -1, null));
            for (int i = 0; i < item.NodePropertyHeadersExpected.Length; i++)
                list2.Add(new HeaderField(item.NodePropertyHeadersExpected[i], VnaFileSection.None, -1, null));
            reader.RemoveDuplicatesFromSecondList(list1, list2);

            Assert.Equal(item.NodePropertyHeadersExpected.Length, list2.Count);
        }
Ejemplo n.º 2
0
        public void RemoveDuplicatesFromSecondList_Removes_Duplicates_From_Second_List( int index, string[] inputs1, string[] inputs2, string[] expectedResults2)
        {
            var reader = new VnaAdjListReader();
            // build test lists, Section and index do not matter
            var list1 = new List<HeaderField>();
            var list2 = new List<HeaderField>();
            for (int i = 0; i < inputs1.Length; i++)
                list1.Add(new HeaderField(inputs1[i], VnaFileSection.None, -1, null));
            for (int i = 0; i < inputs2.Length; i++)
                list2.Add(new HeaderField(inputs2[i], VnaFileSection.None, -1, null));
            reader.RemoveDuplicatesFromSecondList(list1, list2);

            Assert.Equal(expectedResults2.Length, list2.Count);
            for (int i = 0; i < expectedResults2.Length; i++)
            {
                Assert.Equal(expectedResults2[i], list2[i].AttribColName);
            }
        }