public void Does_indexed_column_Jet_binary_mapping()
        {
            var entityType = CreateEntityType();
            var property   = entityType.AddProperty("MyProp", typeof(byte[]));

            entityType.AddIndex(property);

            var typeMapping = new JetTypeMapper(new RelationalTypeMapperDependencies()).GetMapping(property);

            Assert.Equal(DbType.Binary, typeMapping.DbType);
            Assert.Equal("varbinary(510)", typeMapping.StoreType);
            Assert.Equal(510, typeMapping.CreateParameter(new TestCommand(), "Name", new byte[3]).Size);
        }
        public void Does_key_Jet_binary_mapping()
        {
            var property = CreateEntityType().AddProperty("MyProp", typeof(byte[]));

            property.IsNullable = false;
            property.DeclaringEntityType.SetPrimaryKey(property);

            var typeMapping = new JetTypeMapper(new RelationalTypeMapperDependencies()).GetMapping(property);

            Assert.Equal(DbType.Binary, typeMapping.DbType);
            Assert.Equal("varbinary(510)", typeMapping.StoreType);
            Assert.Equal(510, typeMapping.CreateParameter(new TestCommand(), "Name", new byte[3]).Size);
        }
        public void Does_non_key_Jet_rowversion_mapping()
        {
            var property = CreateEntityType().AddProperty("MyProp", typeof(byte[]));

            property.IsConcurrencyToken = true;
            property.ValueGenerated     = ValueGenerated.OnAddOrUpdate;

            var typeMapping = new JetTypeMapper(new RelationalTypeMapperDependencies()).GetMapping(property);

            Assert.Equal(DbType.Binary, typeMapping.DbType);
            Assert.Equal("varbinary(8)", typeMapping.StoreType);
            Assert.Equal(8, typeMapping.Size);
            Assert.Equal(8, typeMapping.CreateParameter(new TestCommand(), "Name", new byte[8]).Size);
        }
        public void Does_indexed_column_Jet_string_mapping()
        {
            var entityType = CreateEntityType();
            var property   = entityType.AddProperty("MyProp", typeof(string));

            entityType.AddIndex(property);

            var typeMapping = new JetTypeMapper(new RelationalTypeMapperDependencies()).GetMapping(property);

            Assert.Equal(DbType.String, typeMapping.DbType);
            Assert.Equal("varchar(255)", typeMapping.StoreType);
            Assert.Equal(255, typeMapping.Size);
            Assert.True(typeMapping.IsUnicode);
            Assert.Equal(255, typeMapping.CreateParameter(new TestCommand(), "Name", "Value").Size);
        }
        public void Does_key_Jet_string_mapping()
        {
            var property = CreateEntityType().AddProperty("MyProp", typeof(string));

            property.IsNullable = false;
            property.DeclaringEntityType.SetPrimaryKey(property);

            var typeMapping = new JetTypeMapper(new RelationalTypeMapperDependencies()).GetMapping(property);

            Assert.Equal(DbType.String, typeMapping.DbType);
            Assert.Equal("varchar(255)", typeMapping.StoreType);
            Assert.Equal(255, typeMapping.Size);
            Assert.True(typeMapping.IsUnicode);
            Assert.Equal(255, typeMapping.CreateParameter(new TestCommand(), "Name", "Value").Size);
        }