Ejemplo n.º 1
0
        public void Extract_TableWithRows_ShouldMapToArrayOfElements()
        {
            // Arrange
            var          tableHandle = (IntPtr)3334;
            var          rowHandle   = (IntPtr)4445;
            uint         rowCount    = 3;
            int          intValue    = 888;
            RfcErrorInfo errorInfo;

            _interopMock.Setup(x => x.GetTable(It.IsAny <IntPtr>(), It.IsAny <string>(), out tableHandle, out errorInfo));
            _interopMock.Setup(x => x.GetRowCount(It.IsAny <IntPtr>(), out rowCount, out errorInfo));
            _interopMock.Setup(x => x.GetCurrentRow(It.IsAny <IntPtr>(), out errorInfo)).Returns(rowHandle);
            _interopMock.Setup(x => x.GetInt(It.IsAny <IntPtr>(), It.IsAny <string>(), out intValue, out errorInfo));

            // Act
            ArrayModel result = OutputMapper.Extract <ArrayModel>(_interopMock.Object, DataHandle);

            // Assert
            _interopMock.Verify(
                x => x.GetTable(DataHandle, "ELEMENTS", out tableHandle, out errorInfo),
                Times.Once);
            _interopMock.Verify(
                x => x.GetRowCount(tableHandle, out rowCount, out errorInfo),
                Times.Once);
            _interopMock.Verify(
                x => x.GetCurrentRow(tableHandle, out errorInfo),
                Times.Exactly(3));
            _interopMock.Verify(
                x => x.GetInt(rowHandle, "VALUE", out intValue, out errorInfo),
                Times.Exactly(3));
            _interopMock.Verify(x => x.MoveToNextRow(tableHandle, out errorInfo), Times.Exactly(3));
            result.Should().NotBeNull();
            result.Elements.Should().HaveCount(3);
            result.Elements.First().Value.Should().Be(888);
        }
Ejemplo n.º 2
0
        public void Extract_DateTime_ShouldMapFromDate()
        {
            // Arrange
            const string value = "20200405";
            RfcErrorInfo errorInfo;

            _interopMock
            .Setup(x => x.GetDate(It.IsAny <IntPtr>(), It.IsAny <string>(), It.IsAny <char[]>(), out errorInfo))
            .Callback(new GetDateCallback((IntPtr dataHandle, string name, char[] buffer, out RfcErrorInfo ei) =>
            {
                Array.Copy(value.ToCharArray(), buffer, value.Length);
                ei = default;
            }));

            // Act
            DateTimeModel result = OutputMapper.Extract <DateTimeModel>(_interopMock.Object, DataHandle);

            // Assert
            _interopMock.Verify(
                x => x.GetDate(DataHandle, "DATETIMEVALUE", It.IsAny <char[]>(), out errorInfo),
                Times.Once);
            _interopMock.Verify(
                x => x.GetDate(DataHandle, "NULLABLEDATETIMEVALUE", It.IsAny <char[]>(), out errorInfo),
                Times.Once);
            result.Should().NotBeNull();
            result.DateTimeValue.Should().Be(new DateTime(2020, 04, 05));
            result.NullableDateTimeValue.Should().Be(new DateTime(2020, 04, 05));
        }
Ejemplo n.º 3
0
        public void Extract_TimeSpan_ShouldMapFromTime()
        {
            // Arrange
            const string value = "123456";
            RfcErrorInfo errorInfo;

            _interopMock
            .Setup(x => x.GetTime(It.IsAny <IntPtr>(), It.IsAny <string>(), It.IsAny <char[]>(), out errorInfo))
            .Callback(new GetTimeCallback((IntPtr dataHandle, string name, char[] buffer, out RfcErrorInfo ei) =>
            {
                Array.Copy(value.ToCharArray(), buffer, value.Length);
                ei = default;
            }));

            // Act
            TimeSpanModel result = OutputMapper.Extract <TimeSpanModel>(_interopMock.Object, DataHandle);

            // Assert
            _interopMock.Verify(
                x => x.GetTime(DataHandle, "TIMESPANVALUE", It.IsAny <char[]>(), out errorInfo),
                Times.Once);
            _interopMock.Verify(
                x => x.GetTime(DataHandle, "NULLABLETIMESPANVALUE", It.IsAny <char[]>(), out errorInfo),
                Times.Once);
            result.Should().NotBeNull();
            result.TimeSpanValue.Should().Be(new TimeSpan(12, 34, 56));
            result.NullableTimeSpanValue.Should().Be(new TimeSpan(12, 34, 56));
        }
Ejemplo n.º 4
0
        public void Extract_TableWithLessRowsThanAnnounced_ShouldReturnExtractedRows()
        {
            // Arrange
            var          tableHandle = (IntPtr)3334;
            var          rowHandle   = (IntPtr)4445;
            uint         rowCount    = 3;
            int          intValue    = 888;
            RfcErrorInfo errorInfo;

            _interopMock.Setup(x => x.GetTable(It.IsAny <IntPtr>(), It.IsAny <string>(), out tableHandle, out errorInfo));
            _interopMock.Setup(x => x.GetRowCount(It.IsAny <IntPtr>(), out rowCount, out errorInfo));
            _interopMock.Setup(x => x.MoveToFirstRow(It.IsAny <IntPtr>(), out errorInfo));
            _interopMock.Setup(x => x.GetCurrentRow(It.IsAny <IntPtr>(), out errorInfo)).Returns(rowHandle);
            _interopMock.Setup(x => x.GetInt(It.IsAny <IntPtr>(), It.IsAny <string>(), out intValue, out errorInfo));

            _interopMock
            .Setup(x => x.MoveToNextRow(It.IsAny <IntPtr>(), out errorInfo))
            .Returns(RfcResultCode.RFC_TABLE_MOVE_EOF);

            // Act
            ArrayModel result = OutputMapper.Extract <ArrayModel>(_interopMock.Object, DataHandle);

            // Assert
            result.Should().NotBeNull();
            result.Elements.Should().HaveCount(1);
        }
        private void TrySaveAnswer(OutputDto output, QuestionId id, uint retries = 25)
        {
            try
            {
                var questionnaire = Context.QuestionnaireGateway.Get(id.QuestionaireId);

                if (questionnaire.LockQuestion && Request.IsAnonymousUser && questionnaire.GetSlide(id.Id).IsCompleted)
                {
                    throw new SlideLockedException("Slide has been locked by calling Slide/Complete while LockQuestion is specified on the experiment",
                                                   "The requested slide is not available for editing");
                }

                var question = questionnaire.GetQuestion(id.Id);
                question.Output = OutputMapper.Map(output);

                Context.QuestionGateway.Save(question);
            }
            catch (InvalidRevisionException e)
            {
                if (retries > 0)
                {
                    TrySaveAnswer(output, id, retries - 1);
                }
                else
                {
                    throw new ServerException("Failed to save answer", "Your answer wasn't saved, try again.", e);
                }
            }
        }
Ejemplo n.º 6
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldNoteDeprecatedFields() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void ShouldNoteDeprecatedFields()
        {
            // when
            OutputMapper mapper = mapper(typeof(RecordWithDeprecatedFields));

            // then
            assertThat(mapper.Signature(), containsInAnyOrder(outputField("deprecated", NTString, true), outputField("alsoDeprecated", NTString, true), outputField("replacement", NTString, false)));
        }
Ejemplo n.º 7
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldMapSimpleRecordWithString() throws Throwable
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void ShouldMapSimpleRecordWithString()
        {
            // When
            OutputMapper mapper = mapper(typeof(SingleStringFieldRecord));

            // Then
            assertThat(mapper.Signature(), contains(outputField("name", NTString)));
            assertThat(asList(mapper.Apply(new SingleStringFieldRecord("hello, world!"))), contains("hello, world!"));
        }
Ejemplo n.º 8
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldSkipStaticFields() throws Throwable
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void ShouldSkipStaticFields()
        {
            // When
            OutputMapper mapper = mapper(typeof(RecordWithStaticFields));

            // Then
            assertThat(mapper.Signature(), contains(outputField("includeMe", NTString)));
            assertThat(asList(mapper.Apply(new RecordWithStaticFields("hello, world!"))), contains("hello, world!"));
        }
Ejemplo n.º 9
0
        public void Extract_UnknownTypeThatCannotBeExtracted_ShouldThrowException()
        {
            // Arrange & Act
            Action action = () => OutputMapper.Extract <UnknownTypeModel>(_interopMock.Object, DataHandle);

            // Assert
            action.Should().Throw <InvalidOperationException>()
            .WithMessage("No matching extract method found for type Single");
        }
Ejemplo n.º 10
0
        protected TestBase()
        {
            Output      = new OutputMapper <TSource, TTarget>(GetName());
            Mapster     = new MapsterMapper <TSource, TTarget>(GetName());
            Handwritten = new HandwrittenMapper <TSource, TTarget>(GetName());
            AutoMapper  = new AutoMapMapper <TSource, TTarget>(GetName());

            _source = InitializeSource();
        }
Ejemplo n.º 11
0
        public static TableField <T> Extract <T>(RfcInterop interop, IntPtr dataHandle, string name)
        {
            RfcResultCode resultCode = interop.GetTable(
                dataHandle: dataHandle,
                name: name,
                tableHandle: out IntPtr tableHandle,
                errorInfo: out RfcErrorInfo errorInfo);

            resultCode.ThrowOnError(errorInfo);

            resultCode = interop.GetRowCount(
                tableHandle: tableHandle,
                rowCount: out uint rowCount,
                errorInfo: out errorInfo);

            resultCode.ThrowOnError(errorInfo);

            if (rowCount == 0)
            {
                return(new TableField <T>(name, Array.Empty <T>()));
            }

            var rows = new T[rowCount];

            resultCode = interop.MoveToFirstRow(
                tableHandle: tableHandle,
                errorInfo: out errorInfo);

            resultCode.ThrowOnError(errorInfo);

            for (int i = 0; i < rowCount; i++)
            {
                IntPtr rowHandle = interop.GetCurrentRow(
                    tableHandle: tableHandle,
                    errorInfo: out errorInfo);

                errorInfo.ThrowOnError();

                rows[i] = OutputMapper.Extract <T>(interop, rowHandle);

                resultCode = interop.MoveToNextRow(
                    tableHandle: tableHandle,
                    errorInfo: out errorInfo);

                if (resultCode == RfcResultCode.RFC_TABLE_MOVE_EOF)
                {
                    Array.Resize(ref rows, i + 1);
                    break;
                }

                resultCode.ThrowOnError(errorInfo);
            }

            return(new TableField <T>(name, rows));
        }
Ejemplo n.º 12
0
        public static StructureField <T> Extract <T>(IRfcInterop interop, IntPtr dataHandle, string name)
        {
            RfcResultCodes resultCode = interop.GetStructure(
                dataHandle: dataHandle,
                name: name,
                structHandle: out IntPtr structHandle,
                out RfcErrorInfo errorInfo);

            resultCode.ThrowOnError(errorInfo);

            T structValue = OutputMapper.Extract <T>(interop, structHandle);

            return(new StructureField <T>(name, structValue));
        }
Ejemplo n.º 13
0
        public void Extract_Double_ShouldMapFromFloat(double value)
        {
            // Arrange
            var          doubleValue = value;
            RfcErrorInfo errorInfo;

            _interopMock.Setup(x => x.GetFloat(DataHandle, "DOUBLEVALUE", out doubleValue, out errorInfo));

            // Act
            DoubleModel result = OutputMapper.Extract <DoubleModel>(_interopMock.Object, DataHandle);

            // Assert
            result.Should().NotBeNull();
            result.DoubleValue.Should().Be(doubleValue);
        }
Ejemplo n.º 14
0
        public void Extract_Long_ShouldMapFromInt8(long value)
        {
            // Arrange
            var          longValue = value;
            RfcErrorInfo errorInfo;

            _interopMock.Setup(x => x.GetInt8(DataHandle, "LONGVALUE", out longValue, out errorInfo));

            // Act
            LongModel result = OutputMapper.Extract <LongModel>(_interopMock.Object, DataHandle);

            // Assert
            result.Should().NotBeNull();
            result.LongValue.Should().Be(longValue);
        }
Ejemplo n.º 15
0
        public void Extract_PropertyWithSapNameAttribute_ShouldMapUsingRfcName()
        {
            // Arrange
            int          value = 334;
            RfcErrorInfo errorInfo;

            _interopMock.Setup(x => x.GetInt(DataHandle, "I34", out value, out errorInfo));

            // Act
            IntAttributeModel result = OutputMapper.Extract <IntAttributeModel>(_interopMock.Object, DataHandle);

            // Assert
            result.Should().NotBeNull();
            result.IntValue.Should().Be(334);
        }
Ejemplo n.º 16
0
        public void Extract_Int_ShouldMapFromInt(int value)
        {
            // Arrange
            int          intValue = value;
            RfcErrorInfo errorInfo;

            _interopMock.Setup(x => x.GetInt(DataHandle, "INTVALUE", out intValue, out errorInfo));

            // Act
            IntModel result = OutputMapper.Extract <IntModel>(_interopMock.Object, DataHandle);

            // Assert
            result.Should().NotBeNull();
            result.IntValue.Should().Be(intValue);
        }
Ejemplo n.º 17
0
        public void Extract_PropertyWithIgnoreAttribute_ShouldBeIgnored()
        {
            // Arrange
            int          value = 123;
            RfcErrorInfo errorInfo;

            _interopMock.Setup(x => x.GetInt(DataHandle, "VALUE", out value, out errorInfo));

            // Act
            IgnoreAttributeModel result = OutputMapper.Extract <IgnoreAttributeModel>(_interopMock.Object, DataHandle);

            // Assert
            _interopMock.Verify(x => x.GetInt(DataHandle, "VALUE", out value, out errorInfo), Times.Never);

            result.Should().NotBeNull();
            result.Value.Should().Be(0);
        }
Ejemplo n.º 18
0
        public void Extract_EmptyCharArray_ShouldMapAsEmptyCharArray()
        {
            // Arrange
            RfcErrorInfo errorInfo;
            uint         bufferLength = 0;

            _interopMock.Setup(x => x.GetChars(It.IsAny <IntPtr>(), It.IsAny <string>(), It.IsAny <char[]>(), bufferLength, out errorInfo));

            // Act
            EmptyCharsModel result = OutputMapper.Extract <EmptyCharsModel>(_interopMock.Object, DataHandle);

            // Assert
            _interopMock.Verify(
                x => x.GetChars(DataHandle, "CHARSVALUE", Array.Empty <char>(), 0, out errorInfo),
                Times.Never);
            result.Should().NotBeNull();
            result.CharsValue.Should().BeEmpty();
        }
Ejemplo n.º 19
0
        public static TableField <T> Extract <T>(IRfcInterop interop, IntPtr dataHandle, string name)
        {
            RfcResultCodes resultCode = interop.GetTable(
                dataHandle: dataHandle,
                name: name,
                tableHandle: out IntPtr tableHandle,
                errorInfo: out RfcErrorInfo errorInfo);

            resultCode.ThrowOnError(errorInfo);

            resultCode = interop.GetRowCount(
                tableHandle: tableHandle,
                out uint rowCount,
                out errorInfo);

            resultCode.ThrowOnError(errorInfo);

            var rows = new T[rowCount];

            for (int i = 0; i < rowCount; i++)
            {
                IntPtr rowHandle = interop.GetCurrentRow(
                    tableHandle: tableHandle,
                    errorInfo: out errorInfo);

                errorInfo.ThrowOnError();

                rows[i] = OutputMapper.Extract <T>(interop, rowHandle);

                resultCode = interop.MoveToNextRow(
                    tableHandle: tableHandle,
                    errorInfo: out errorInfo);

                if (resultCode == RfcResultCodes.RFC_TABLE_MOVE_EOF)
                {
                    return(new TableField <T>(name, rows.Take(i + 1).ToArray()));
                }

                resultCode.ThrowOnError(errorInfo);
            }

            return(new TableField <T>(name, rows));
        }
Ejemplo n.º 20
0
        public void Extract_Decimal_EmptyString_ShouldMapToDecimalZero()
        {
            // Assert
            uint         stringLength = 0;
            RfcErrorInfo errorInfo;

            _interopMock.Setup(x => x.GetString(It.IsAny <IntPtr>(), It.IsAny <string>(), It.IsAny <char[]>(), It.IsAny <uint>(), out stringLength, out errorInfo));

            // Act
            DecimalModel result = OutputMapper.Extract <DecimalModel>(_interopMock.Object, DataHandle);

            // Assert
            uint discard;

            _interopMock.Verify(
                x => x.GetString(DataHandle, "DECIMALVALUE", Array.Empty <char>(), 0, out discard, out errorInfo),
                Times.Once);
            result.Should().NotBeNull();
            result.DecimalValue.Should().Be(0M);
        }
Ejemplo n.º 21
0
        public void Extract_EmptyString_ShouldMapAsEmptyString()
        {
            // Arrange
            RfcErrorInfo errorInfo;
            uint         stringLength = 0;

            _interopMock.Setup(x => x.GetString(It.IsAny <IntPtr>(), It.IsAny <string>(), It.IsAny <char[]>(), It.IsAny <uint>(), out stringLength, out errorInfo));

            // Act
            StringModel result = OutputMapper.Extract <StringModel>(_interopMock.Object, DataHandle);

            // Assert
            uint discard;

            _interopMock.Verify(
                x => x.GetString(DataHandle, "STRINGVALUE", Array.Empty <char>(), 0, out discard, out errorInfo),
                Times.Once);
            result.Should().NotBeNull();
            result.StringValue.Should().BeEmpty();
        }
Ejemplo n.º 22
0
        public void Extract_Decimal_ShouldMapFromDecimalString(double val)
        {
            decimal value = (decimal)val;
            // Assert
            string       stringValue  = value.ToString("G", CultureInfo.InvariantCulture);
            uint         stringLength = (uint)stringValue.Length;
            RfcErrorInfo errorInfo;
            var          resultCodeQueue = new Queue <RfcResultCodes>();

            resultCodeQueue.Enqueue(RfcResultCodes.RFC_BUFFER_TOO_SMALL);
            resultCodeQueue.Enqueue(RfcResultCodes.RFC_OK);
            _interopMock
            .Setup(x => x.GetString(It.IsAny <IntPtr>(), It.IsAny <string>(), It.IsAny <char[]>(), It.IsAny <uint>(), out stringLength, out errorInfo))
            .Callback(new GetStringCallback((IntPtr dataHandle, string name, char[] buffer, uint bufferLength, out uint sl, out RfcErrorInfo ei) =>
            {
                ei = default;
                sl = stringLength;
                if (buffer.Length <= 0 || bufferLength <= 0)
                {
                    return;
                }
                Array.Copy(stringValue.ToCharArray(), buffer, stringValue.Length);
            }))
            .Returns(resultCodeQueue.Dequeue);

            // Act
            DecimalModel result = OutputMapper.Extract <DecimalModel>(_interopMock.Object, DataHandle);

            // Assert
            uint discard;

            _interopMock.Verify(
                x => x.GetString(DataHandle, "DECIMALVALUE", Array.Empty <char>(), 0, out discard, out errorInfo),
                Times.Once);
            _interopMock.Verify(
                x => x.GetString(DataHandle, "DECIMALVALUE", It.IsAny <char[]>(), stringLength + 1, out discard, out errorInfo),
                Times.Once);
            result.Should().NotBeNull();
            result.DecimalValue.Should().Be(value);
        }
Ejemplo n.º 23
0
        public void Extract_CharArray_ShouldMapFromCharArray(char[] value)
        {
            // Arrange
            RfcErrorInfo errorInfo;

            _interopMock
            .Setup(x => x.GetChars(It.IsAny <IntPtr>(), It.IsAny <string>(), It.IsAny <char[]>(), It.IsAny <uint>(), out errorInfo))
            .Callback(new GetCharsCallback((IntPtr dataHandle, string name, char[] buffer, uint bufferLength, out RfcErrorInfo ei) =>
            {
                Array.Copy(value, buffer, value.Length);
                ei = default;
            }));

            // Act
            CharsModel result = OutputMapper.Extract <CharsModel>(_interopMock.Object, DataHandle);

            // Assert
            _interopMock.Verify(
                x => x.GetChars(DataHandle, "CHARSVALUE", It.IsAny <char[]>(), 3, out errorInfo),
                Times.Once);
            result.Should().NotBeNull();
            result.CharsValue.Should().BeEquivalentTo(value);
        }
Ejemplo n.º 24
0
        public void Extract_NonNullableTimeSpan_ZeroOrEmptyOrInvalidTime_ShouldMapToZeroTimeSpan(string value)
        {
            // Arrange
            RfcErrorInfo errorInfo;

            _interopMock
            .Setup(x => x.GetTime(It.IsAny <IntPtr>(), It.IsAny <string>(), It.IsAny <char[]>(), out errorInfo))
            .Callback(new GetTimeCallback((IntPtr dataHandle, string name, char[] buffer, out RfcErrorInfo ei) =>
            {
                Array.Copy(value.ToCharArray(), buffer, value.Length);
                ei = default;
            }));

            // Act
            TimeSpanModel result = OutputMapper.Extract <TimeSpanModel>(_interopMock.Object, DataHandle);

            // Assert
            _interopMock.Verify(
                x => x.GetTime(DataHandle, "TIMESPANVALUE", It.IsAny <char[]>(), out errorInfo),
                Times.Once);
            result.Should().NotBeNull();
            result.TimeSpanValue.Should().Be(TimeSpan.Zero);
        }
Ejemplo n.º 25
0
        public void Extract_TableWithZeroRows_ShouldNotCallMoveToFirstRow()
        {
            // Arrange
            var          tableHandle = (IntPtr)3334;
            var          rowHandle   = (IntPtr)4445;
            uint         rowCount    = 0;
            RfcErrorInfo errorInfo;

            _interopMock.Setup(x => x.GetTable(It.IsAny <IntPtr>(), It.IsAny <string>(), out tableHandle, out errorInfo));
            _interopMock.Setup(x => x.GetRowCount(It.IsAny <IntPtr>(), out rowCount, out errorInfo));
            _interopMock.Setup(x => x.MoveToFirstRow(It.IsAny <IntPtr>(), out errorInfo));
            _interopMock.Setup(x => x.GetCurrentRow(It.IsAny <IntPtr>(), out errorInfo)).Returns(rowHandle);

            _interopMock
            .Setup(x => x.MoveToNextRow(It.IsAny <IntPtr>(), out errorInfo))
            .Returns(RfcResultCode.RFC_TABLE_MOVE_EOF);

            // Act
            ArrayModel result = OutputMapper.Extract <ArrayModel>(_interopMock.Object, DataHandle);

            // Assert
            _interopMock.Verify(
                x => x.GetTable(DataHandle, "ELEMENTS", out tableHandle, out errorInfo),
                Times.Once);
            _interopMock.Verify(
                x => x.GetRowCount(tableHandle, out rowCount, out errorInfo),
                Times.Once);
            _interopMock.Verify(
                x => x.MoveToFirstRow(tableHandle, out errorInfo),
                Times.Never);
            _interopMock.Verify(
                x => x.GetCurrentRow(tableHandle, out errorInfo),
                Times.Never);
            _interopMock.Verify(x => x.MoveToNextRow(tableHandle, out errorInfo), Times.Never);
            result.Should().NotBeNull();
            result.Elements.Should().HaveCount(0);
        }
Ejemplo n.º 26
0
        public void Extract_Structure_ShouldMapToNestedObject()
        {
            // Arrange
            var          structHandle = (IntPtr)443534;
            var          intValue     = 123;
            RfcErrorInfo errorInfo;

            _interopMock.Setup(x => x.GetStructure(It.IsAny <IntPtr>(), It.IsAny <string>(), out structHandle, out errorInfo));
            _interopMock.Setup(x => x.GetInt(It.IsAny <IntPtr>(), It.IsAny <string>(), out intValue, out errorInfo));

            // Act
            NestedModel result = OutputMapper.Extract <NestedModel>(_interopMock.Object, DataHandle);

            // Assert
            _interopMock.Verify(
                x => x.GetStructure(DataHandle, "INNERMODEL", out structHandle, out errorInfo),
                Times.Once);
            _interopMock.Verify(
                x => x.GetInt(structHandle, "VALUE", out intValue, out errorInfo),
                Times.Once);
            result.Should().NotBeNull();
            result.InnerModel.Should().NotBeNull();
            result.InnerModel.Value.Should().Be(123);
        }
Ejemplo n.º 27
0
        /// <inheritdoc cref="ISapFunction"/>
        public TOutput Invoke <TOutput>(object input)
        {
            Invoke(input);

            return(OutputMapper.Extract <TOutput>(_interop, _functionHandle));
        }
Ejemplo n.º 28
0
 /// <inheritdoc cref="ISapServerFunction"/>
 public TOutput GetParameters <TOutput>()
 {
     return(OutputMapper.Extract <TOutput>(_interop, _functionHandle));
 }
Ejemplo n.º 29
0
 public TOutput ReadSubmitResult <TOutput>()
 {
     return(OutputMapper.Extract <TOutput>(_interop, _functionHandle));
 }
Ejemplo n.º 30
0
        public async Task <TOutput> InvokeAsync <TOutput>(object input)
        {
            await InvokeAsync(input);

            return(OutputMapper.Extract <TOutput>(_interop, _functionHandle));
        }