public void WithElementMap_MapReturnsNull_ThrowsArgumentNullException() { var cellValuesReader = new MultipleColumnNamesValueReader("Column"); var elementPipeline = new ValuePipeline <string>(); CreateElementsFactory <string> createElementsFactory = elements => elements; var propertyMap = new ManyToOneEnumerableMap <string>(cellValuesReader, elementPipeline, createElementsFactory); Assert.Throws <ArgumentNullException>("elementMap", () => propertyMap.WithElementMap(e => null)); }
public void WithElementMap_ValidMap_Success() { var cellValuesReader = new MultipleColumnNamesValueReader("Column"); var elementPipeline = new ValuePipeline <string>(); CreateElementsFactory <string> createElementsFactory = elements => elements; var propertyMap = new ManyToOneEnumerableMap <string>(cellValuesReader, elementPipeline, createElementsFactory); var newElementPipeline = new ValuePipeline <string>(); Assert.Same(propertyMap, propertyMap.WithElementMap(e => { Assert.Same(e, propertyMap.ElementPipeline); return(newElementPipeline); })); Assert.Same(newElementPipeline, propertyMap.ElementPipeline); }