コード例 #1
0
        public void CreateCommonMetadata()
        {
            var metadataFactory = new MetadataFactory();

            MetadataOracleCommon actual = metadataFactory.CreateCommon();

            Assert.NotNull(actual);
        }
コード例 #2
0
 internal ServiceForOracle(ILogger <ServiceForOracle> logger, IDbConnectionFactory factory, IMetadataBuilderFactory builderFactory, IOracleRefCursorWrapperFactory wrapperFactory, IMetadataFactory metadataFactory)
 {
     _Logger                  = logger;
     _DbFactory               = factory ?? throw new ArgumentNullException(nameof(factory));
     _MetadataFactory         = metadataFactory ?? throw new ArgumentNullException(nameof(metadataFactory));
     _Common                  = _MetadataFactory.CreateCommon();
     _BuilderFactory          = builderFactory ?? throw new ArgumentNullException(nameof(builderFactory));
     _RefCursorWrapperFactory = wrapperFactory ?? throw new ArgumentNullException(nameof(wrapperFactory));
 }
コード例 #3
0
        internal void Constructor_ThreeParameters(string value, ParameterDirection direction, MetadataOracleCommon metadata)
        {
            var param = new ParamClrType <string>(value, direction, metadata);

            Assert.Equal(value, param.Value);
            Assert.Equal(direction, param.Direction);
            Assert.Equal(metadata, param.Metadata);
        }
コード例 #4
0
 internal ParamClrType(T value, ParameterDirection direction, MetadataOracleCommon metadata)
     : base(typeof(T), value, direction)
 {
     Metadata = metadata;
     Value    = value;
 }
コード例 #5
0
        internal void GetDeclareLine_Collection(MetadataOracleNetTypeDefinition typedef, MetadataOracleCommon common, string parameterName, OracleUdtInfo udtInfo)
        {
            var type = typeof(ComplexTestClass[]);

            var metadata = new MetadataOracleObject <ComplexTestClass[]>(typedef, common);

            var declareLine = metadata.GetDeclareLine(type, parameterName, udtInfo);

            var expected = $"{parameterName} {udtInfo.FullCollectionName} := {udtInfo.FullCollectionName}();" + Environment.NewLine;

            Assert.Equal(expected, declareLine);
        }
コード例 #6
0
        internal void GetDeclareLine_Object_WithMetadata(MetadataOracleNetTypeDefinition typedef, MetadataOracleNetTypeDefinition subTypeDef, MetadataOracleCommon common, string parameterName, OracleUdtInfo udtInfo)
        {
            var type = typeof(ComplexTestClass);
            var prop = typedef.Properties.First();

            prop.PropertyMetadata = subTypeDef;
            prop.NETProperty      = type.GetProperty(nameof(ComplexTestClass.ObjectProp));


            var metadata = new MetadataOracleObject <ComplexTestClass>(typedef, common);

            var declareLine = metadata.GetDeclareLine(type, parameterName, udtInfo);

            var expected = $"{parameterName}_0 {subTypeDef.UDTInfo.FullObjectName};" + Environment.NewLine
                           + $"{parameterName} {udtInfo.FullObjectName};" + Environment.NewLine;

            Assert.Equal(expected, declareLine);
        }
コード例 #7
0
        internal void GetDeclareLine_Object_Simple(MetadataOracleNetTypeDefinition typedef, MetadataOracleCommon common, string parameterName, OracleUdtInfo udtInfo)
        {
            var type     = typeof(SimpleTestClass);
            var metadata = new MetadataOracleObject <SimpleTestClass>(typedef, common);

            var declareLine = metadata.GetDeclareLine(type, parameterName, udtInfo);

            Assert.Equal($"{parameterName} {udtInfo.FullObjectName};" + Environment.NewLine, declareLine);
        }