Esempio n. 1
0
        public void HasDefinitionForColumn_ForDefinedColumn_ReturnsTrue()
        {
            _sut.AddMapping(0, TestDataClass.PropertyNameFieldA);

            var result = _sut.HasDefinitionForColumn(0);

            Assert.That(result, Is.True);
        }
Esempio n. 2
0
        public IColumnMapBuilder <TData> WithColumn <TTarget>(int columnIndex, Expression <Func <TData, TTarget> > propertyExpression)
        {
            var memberExpression = propertyExpression.Body as MemberExpression;

            if (memberExpression == null)
            {
                throw new ArgumentException("The given Expression is not a member expression.");
            }

            var propertyInfo = memberExpression.Member as PropertyInfo;

            if (propertyInfo == null)
            {
                throw new ArgumentException("The given Expression is not a property.");
            }

            _map.AddMapping(columnIndex, propertyInfo.Name);

            return(this);
        }