Example #1
0
        public void CheckUnicodeWithPrefix()
        {
            var dialect = new Oracle8iDialect();

            var cfg = TestConfigurationHelper.GetDefaultConfiguration();

            cfg.SetProperty(Environment.OracleUseNPrefixedTypesForUnicode, "true");
            dialect.Configure(cfg.Properties);

            Assert.That(dialect.UseNPrefixedTypesForUnicode, Is.True,
                        $"Unexpected value for {nameof(Oracle8iDialect)}.{nameof(Oracle8iDialect.UseNPrefixedTypesForUnicode)} after configuration");

            var unicodeStringType = dialect.GetTypeName(NHibernateUtil.String.SqlType);

            Assert.That(unicodeStringType, Does.StartWith("N").IgnoreCase, "Unexpected type name for an Unicode string");
        }
Example #2
0
        public void CheckUnicode()
        {
            var dialect = new Oracle8iDialect();
            var cfg     = TestConfigurationHelper.GetDefaultConfiguration();

            dialect.Configure(cfg.Properties);
            var useNPrefixedTypesForUnicode = PropertiesHelper.GetBoolean(Environment.OracleUseNPrefixedTypesForUnicode, cfg.Properties, false);

            Assert.That(dialect.UseNPrefixedTypesForUnicode, Is.EqualTo(useNPrefixedTypesForUnicode),
                        $"Unexpected value for {nameof(Oracle8iDialect)}.{nameof(Oracle8iDialect.UseNPrefixedTypesForUnicode)} after configuration");

            var unicodeStringType = dialect.GetTypeName(NHibernateUtil.String.SqlType);

            Assert.That(unicodeStringType, (useNPrefixedTypesForUnicode ? Does.StartWith("N") : Does.Not.StartWith("N")).IgnoreCase,
                        "Unexpected type name for an Unicode string");
        }