Example #1
0
        public void ShouldDoInverseMapForZero()
        {
            // Arrange
            var mapper      = new ByteArrayMapper();
            var mappedValue = mapper.Map(Array.Empty <byte>());

            // Act
            var retrievedValue = mapper.ReverseMap(mappedValue);

            // Assert
            Assert.Empty(retrievedValue);
        }
        protected override RelationalTypeMapping FindCustomMapping([NotNull] IProperty property)
        {
            Check.NotNull(property, nameof(property));

            var clrType = property.ClrType.UnwrapEnumType();

            return(clrType == typeof(string)
                ? StringMapper.FindMapping(true, property.IsKey() || property.IsIndex(), property.GetMaxLength())
                : clrType == typeof(byte[])
                    ? ByteArrayMapper.FindMapping(false, property.IsKey() || property.IsIndex(), property.GetMaxLength())
                    : null);
        }
Example #3
0
 public ByteArrayMapperTests()
 {
     _mapper = new ByteArrayMapper();
 }