Esempio n. 1
0
        public void CreateFunction_ShouldReturnCreatedFunction()
        {
            RfcErrorInfo errorInfo;

            _interopMock
            .Setup(x => x.GetFunctionDesc(It.IsAny <IntPtr>(), It.IsAny <string>(), out errorInfo))
            .Returns(FunctionDescriptionHandle);
            _interopMock
            .Setup(x => x.CreateFunction(It.IsAny <IntPtr>(), out errorInfo))
            .Returns(FunctionHandle);

            var rfcFunction = new RfcFunction(_interopMock.Object);

            IRfcFunction function = rfcFunction.CreateFunction(ConnectionMock.Object, "FunctonA");

            function.Should().NotBeNull();
            _interopMock.Verify(x => x.CreateFunction(FunctionDescriptionHandle, out errorInfo), Times.Once);
        }
Esempio n. 2
0
        public void CreateFunction_functionName_ShouldReturnIRfcFunction()
        {
            var          functionName = "TEST";
            var          connection   = new RfcConnection(_interopMock.Object, RfcConfigurationOption);
            RfcErrorInfo errorInfo;

            _interopMock
            .Setup(x => x.GetFunctionDesc(It.IsAny <IntPtr>(), It.IsAny <string>(), out errorInfo))
            .Returns(FunctionDescriptionHandle);

            _interopMock
            .Setup(x => x.CreateFunction(It.IsAny <IntPtr>(), out errorInfo))
            .Returns(FunctionHandle);

            IRfcFunction function = connection.CreateFunction(functionName);

            function.Should().NotBeNull();
        }