コード例 #1
0
        public void PluginRuntimeHandler_GetNamespaces_WhenValidDll_ExpectNamespaces()
        {
            //------------Setup for test--------------------------
            var source = CreatePluginSource();

            //------------Execute Test---------------------------
            using (Isolated <ComPluginRuntimeHandler> isolated = new Isolated <ComPluginRuntimeHandler>())
            {
                var result = ComPluginServiceExecutionFactory.GetNamespaces(source);
                //------------Assert Results-------------------------
                Assert.IsTrue(result.Count > 0);
            }
        }
コード例 #2
0
        public void ListMethods_GivenAdodbConnection_ShouldContainOpen()
        {
            //---------------Set up test pack-------------------
            const string adodbConGuid = ComPluginRuntimeHandlerTest.adodbConnectionClassId;
            //---------------Assert Precondition----------------
            //---------------Execute Test ----------------------
            var ns = ComPluginServiceExecutionFactory.GetNamespaces(new ComPluginSource {
                ClsId = adodbConGuid
            });

            Assert.IsNotNull(ns);

            var result = ComPluginServiceExecutionFactory.GetMethods(adodbConGuid, true);
            //------------Assert Results-------------------------
            var openMethod = result.First(method => method.Name.ToUpper() == "open".ToUpper());

            //---------------Test Result -----------------------
            Assert.IsNotNull(openMethod);
        }
コード例 #3
0
        private void PerfromExecution(int update, IDSFDataObject dataObject, ComPluginInvokeArgs args)
        {
            if (!IsObject)
            {
                int i = 0;
                foreach (var serviceOutputMapping in Outputs)
                {
                    OutputDescription.DataSourceShapes[0].Paths[i].OutputExpression = DataListUtil.AddBracketsToValueIfNotExist(serviceOutputMapping.MappedTo);
                    i++;
                }
                var outputFormatter = OutputFormatterFactory.CreateOutputFormatter(OutputDescription);
                args.OutputFormatter = outputFormatter;
            }
            Common.Utilities.PerformActionInsideImpersonatedContext(Common.Utilities.ServerUser, () => { _result = ComPluginServiceExecutionFactory.InvokeComPlugin(args).ToString(); });

            ResponseManager = new ResponseManager {
                OutputDescription = OutputDescription, Outputs = Outputs, IsObject = IsObject, ObjectName = ObjectName
            };
            ResponseManager.PushResponseIntoEnvironment(_result, update, dataObject, false);
        }
コード例 #4
0
 public void PluginRuntimeHandler_GetNamespaces_WhenNullDll_ExpectException()
 {
     //------------Execute Test---------------------------
     ComPluginServiceExecutionFactory.GetNamespaces(null);
 }
コード例 #5
0
 protected virtual void ExecuteInsideImpersonatedContext(ComPluginInvokeArgs args)
 {
     Common.Utilities.PerformActionInsideImpersonatedContext(Common.Utilities.ServerUser, () => { _result = ComPluginServiceExecutionFactory.InvokeComPlugin(args).ToString(); });
 }