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); }
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); }
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"); }
public void ExecuteMethod(Guid methodId, Dictionary <string, string> parameters) { _containerManager.ExecuteMethod(methodId, parameters); }