示例#1
0
        public void Can_Set_Enum_Parameter()
        {
            var testClass        = new TestClass();
            var containerManager = new ContainerManager();

            containerManager.AddMethodToContainer("container", () => testClass.SetEnumValue(0), "methodName");

            var method          = containerManager.GetMethodsInContainer("container").Single();
            var parameterValues = new Dictionary <string, string>
            {
                { "value", "Specified" },
            };

            containerManager.ExecuteMethod(method.MethodId, parameterValues);

            testClass.EnumProperty.Should().Be(TestClass.TestEnum.Specified);
        }
示例#2
0
        public void Can_Execute_Static_Method()
        {
            var testClass        = new TestClass();
            var containerManager = new ContainerManager();

            containerManager.AddMethodToContainer("container", () => StaticTestMethod(0), "methodName");

            var method          = containerManager.GetMethodsInContainer("container").Single();
            var parameterValues = new Dictionary <string, string>
            {
                { "value", "1" },
            };

            containerManager.ExecuteMethod(method.MethodId, parameterValues);

            StaticInt.Should().Be(1);
        }
示例#3
0
        public void Can_Execute_Method()
        {
            var testClass        = new TestClass();
            var containerManager = new ContainerManager();

            containerManager.AddMethodToContainer("container", () => testClass.SimpleMethod(0, null), "methodName");

            var method          = containerManager.GetMethodsInContainer("container").Single();
            var parameterValues = new Dictionary <string, string>
            {
                { "param1", "1" },
                { "param2", "two" }
            };

            containerManager.ExecuteMethod(method.MethodId, parameterValues);

            testClass.IntProperty.Should().Be(1);
            testClass.StringProperty.Should().Be("two");
        }
示例#4
0
 public void ExecuteMethod(Guid methodId, Dictionary <string, string> parameters)
 {
     _containerManager.ExecuteMethod(methodId, parameters);
 }