public void CreateCommonMetadata() { var metadataFactory = new MetadataFactory(); MetadataOracleCommon actual = metadataFactory.CreateCommon(); Assert.NotNull(actual); }
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)); }
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); }
internal ParamClrType(T value, ParameterDirection direction, MetadataOracleCommon metadata) : base(typeof(T), value, direction) { Metadata = metadata; Value = value; }
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); }
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); }
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); }