public void HasDefinitionForColumn_ForDefinedColumn_ReturnsTrue() { _sut.AddMapping(0, TestDataClass.PropertyNameFieldA); var result = _sut.HasDefinitionForColumn(0); Assert.That(result, Is.True); }
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); }