Exemple #1
0
        public List <RfcFieldDescription> GetFieldDescriptions(IntPtr typeDescriptionHandler)
        {
            if (typeDescriptionHandler == IntPtr.Zero)
            {
                return(null);
            }

            var fieldsDescriptions = new List <RfcFieldDescription>();

            var count = GetFieldCount(typeDescriptionHandler);

            for (int i = 0; i < count; i++)
            {
                RfcFieldDescription fieldDescription = GetFieldDescriptionByIndex(typeDescriptionHandler, i);
                fieldsDescriptions.Add(fieldDescription);
            }
            return(fieldsDescriptions);
        }
        public void GetParameterDescriptions_typeDescriptionHandle_ShouldRfcParameterDescriptionModelList()
        {
            int          fieldCount = 1;
            RfcErrorInfo errorInfo;
            var          fieldDescription = new RfcFieldDescription {
                Name = "Field Name"
            };

            _interopMock.Setup(s => s.GetFieldCount(It.IsAny <IntPtr>(), out fieldCount, out errorInfo))
            .Returns(RfcResultCodes.RFC_OK);

            _interopMock.Setup(s => s.GetFieldDescByIndex(It.IsAny <IntPtr>(), It.IsAny <int>(), out fieldDescription, out errorInfo))
            .Returns(RfcResultCodes.RFC_OK);
            var functionMetaData = new RfcFunctionMetaData(_interopMock.Object, FunctionDescriptionHandle);

            List <RfcFieldDescription> result = functionMetaData.GetFieldDescriptions(TypeDescriptionHandle);

            result.Should().HaveCount(fieldCount);
            result.First().Name.Should().Be(fieldDescription.Name);
        }
Exemple #3
0
 public SapFieldMetadata(RfcInterop interop, RfcFieldDescription fieldDescription)
 {
     _interop          = interop;
     _fieldDescription = fieldDescription;
 }
Exemple #4
0
 public RfcResultCodes GetFieldDescByName(IntPtr typeDescHandle, string name, out RfcFieldDescription fieldDesc,
                                          out RfcErrorInfo errorInfo)
 => RfcGetFieldDescByName(typeDescHandle, name, out fieldDesc, out errorInfo);
Exemple #5
0
 private static extern RfcResultCodes RfcGetFieldDescByName(IntPtr typeDescHandle, string name, out RfcFieldDescription fieldDesc, out RfcErrorInfo errorInfo);
Exemple #6
0
 public RfcResultCodes GetFieldDescByIndex(IntPtr typeDescHandle, int index, out RfcFieldDescription fieldDesc,
                                           out RfcErrorInfo errorInfo)
 => RfcGetFieldDescByIndex(typeDescHandle, index, out fieldDesc, out errorInfo);
Exemple #7
0
 private static extern RfcResultCodes RfcGetFieldDescByIndex(IntPtr typeDescHandle, int index, out RfcFieldDescription fieldDesc, out RfcErrorInfo errorInfo);