コード例 #1
0
        public void ReadHeadersIntoTargetList_Populates_List_Of_Header_Fields(int index, string[] inputs, string[] expectedResults, int[] expectedIndices, VnaFileSection state)
        {
            var reader = new VnaAdjListReader();
            reader.State = state;
            var target = new List<HeaderField>();
            var count = reader.ReadHeadersIntoTargetList(inputs, target);

            Assert.Equal(expectedResults.Length, count);
            Assert.Equal(expectedResults.Length, target.Count);
            for (int i = 0; i < expectedResults.Length; i++)
            {
                Assert.False(string.IsNullOrWhiteSpace(target[i].AttribColName));
                Assert.Equal(expectedResults[i], target[i].AttribColName);
                Assert.Equal(state, target[i].Section);
                Assert.Equal(expectedIndices[i], target[i].SourceFieldIndex);
            }
        }