Beispiel #1
0
        public void Ctor_ColumnIndices()
        {
            var columnIndices = new int[] { 0, 1 };
            var reader        = new MultipleColumnIndicesValueReader(columnIndices);

            Assert.Same(columnIndices, reader.ColumnIndices);
        }
Beispiel #2
0
        public void WithColumnIndices_ParamsInt_Success()
        {
            var        columnIndices = new int[] { 0, 1 };
            MemberInfo propertyInfo  = typeof(TestClass).GetProperty(nameof(TestClass.Value));
            var        propertyMap   = new SubPropertyMap(propertyInfo).WithColumnNames("ColumnNames");

            Assert.Same(propertyMap, propertyMap.WithColumnIndices(columnIndices));

            MultipleColumnIndicesValueReader reader = Assert.IsType <MultipleColumnIndicesValueReader>(propertyMap.ColumnsReader);

            Assert.Same(columnIndices, reader.ColumnIndices);
        }
        public void WithColumnIndices_ParamsInt_Success()
        {
            var columnIndices    = new int[] { 0, 1 };
            var cellValuesReader = new MultipleColumnNamesValueReader("Column");
            var elementPipeline  = new ValuePipeline <string>();
            CreateElementsFactory <string> createElementsFactory = elements => elements;
            var propertyMap = new ManyToOneEnumerableMap <string>(cellValuesReader, elementPipeline, createElementsFactory).WithColumnNames("ColumnNames");

            Assert.Same(propertyMap, propertyMap.WithColumnIndices(columnIndices));

            MultipleColumnIndicesValueReader reader = Assert.IsType <MultipleColumnIndicesValueReader>(propertyMap.CellValuesReader);

            Assert.Same(columnIndices, reader.ColumnIndices);
        }