Пример #1
0
        public void Test_plugin_2016_execute_nonvirtual_method()
        {
            //Arrange

            string expected = "Hello World!";

            //Create a plug-in mock - this allows the constructor values to be set
            CrmPluginMock pluginMock = new CrmPluginMock {
                UnsecureConfiguration = expected
            };

            //Act

            //Use the ExecuteMethod method of the plug-in mock to execute
            //a method in the workflow - in this case a method named Test3
            string unsecureConfig = String.Empty;
            object result         = pluginMock.ExecuteMethod <ExamplePlugin5>("Test3");

            if (result != null)
            {
                unsecureConfig = result.ToString();
            }

            //Assert

            //Compare the method result to the expected value
            Assert.AreEqual(unsecureConfig, expected);
        }