public GuidTypeMapperTests(DatabaseFixture fixture)
        {
            Fixture = fixture;
            OracleTypeMapper.AddTypeHandler <Guid>(new GuidRaw16TypeHandler());

            var columns = new[]
            {
                new TableColumn {
                    Name = "CustomerId", DataType = OracleMappingType.Raw, Size = 16, PrimaryKey = true
                },
                new TableColumn {
                    Name = "Name", DataType = OracleMappingType.Varchar2, Size = 40
                },
                new TableColumn {
                    Name = "City", DataType = OracleMappingType.Varchar2, Size = 40
                },
                new TableColumn {
                    Name = "OtherGuid", DataType = OracleMappingType.Raw, Size = 16, Nullable = true
                },
            };

            TableCreator.Create(Fixture.Connection, "GuidCustomerTest", columns);
            InsertCustomer(new Customer {
                CustomerId = customerId, Name = "DIPS AS", City = "Oslo"
            });
        }
Example #2
0
        public BooleanStringTypeMapperTests(DatabaseFixture fixture)
        {
            Fixture = fixture;

            var columns = new[]
            {
                new NumberColumn {
                    Name = "Id", DataType = OracleMappingType.Int32, PrimaryKey = true
                },
                new TableColumn {
                    Name = "BooleanValue", DataType = OracleMappingType.Char, Size = 1
                }
            };

            OracleTypeMapper.AddTypeHandler(typeof(bool), new BooleanStringTypeHandler("Y", "N"));
            TableCreator.Create(Fixture.Connection, "BoolCharTypeMappingTest", columns);
        }