public void WithDateFormats_NullableEmptyFormats_ThrowsArgumentException() { OneToOneMap <DateTime?> propertyMap = Map(t => t.NullableDateValue); Assert.Throws <ArgumentException>("formats", () => propertyMap.WithDateFormats(new string[0])); Assert.Throws <ArgumentException>("formats", () => propertyMap.WithDateFormats(new List <string>())); }
public void WithDateFormats_NullableNullFormats_ThrowsArgumentNullException() { OneToOneMap <DateTime?> mapping = Map(t => t.NullableDateValue); Assert.Throws <ArgumentNullException>("formats", () => mapping.WithDateFormats(null)); Assert.Throws <ArgumentNullException>("formats", () => mapping.WithDateFormats((IEnumerable <string>)null)); }
public void WithDateFormats_NullFormats_ThrowsArgumentNullException() { OneToOneMap <DateTime> propertyMap = Map(t => t.DateValue); Assert.Throws <ArgumentNullException>("formats", () => propertyMap.WithDateFormats(null)); Assert.Throws <ArgumentNullException>("formats", () => propertyMap.WithDateFormats((IEnumerable <string>)null)); }
public void WithDateFormats_NullableAutoMappedIEnumerableString_Success(IEnumerable <string> formats) { OneToOneMap <DateTime?> propertyMap = Map(t => t.NullableDateValue); Assert.Same(propertyMap, propertyMap.WithDateFormats(formats)); DateTimeMapper item = propertyMap.Pipeline.CellValueMappers.OfType <DateTimeMapper>().Single(); Assert.Equal(formats, item.Formats); }
public void WithDateFormats_NullableAutoMappedStringArray_Success(IEnumerable <string> formats) { var formatsArray = formats.ToArray(); OneToOneMap <DateTime?> propertyMap = Map(t => t.NullableDateValue); Assert.Same(propertyMap, propertyMap.WithDateFormats(formatsArray)); DateTimeMapper item = propertyMap.Pipeline.CellValueMappers.OfType <DateTimeMapper>().Single(); Assert.Same(formatsArray, item.Formats); }