public void CreateProxyFromAbstractClassWithEnumArrayOutParameterTest() { // Arrange var invocationHandler = new SetParametersInvocationHandler {Parameters = new object[] {new[] {EnumType.Two}}}; // Act var proxy = _proxyFactory.CreateProxy<EnumArrayOutParameterBase>(Type.EmptyTypes, invocationHandler); EnumType[] value; proxy.Method(out value); // Assert Assert.That(invocationHandler.Parameters[0], Is.EqualTo(new[] {EnumType.Two})); }
public void CreateProxyFromAbstractClassWithStructOutParameterTest() { // Arrange var invocationHandler = new SetParametersInvocationHandler {Parameters = new object[] {new StructType {Integer = 2, String = "2"}}}; // Act var proxy = _proxyFactory.CreateProxy<StructOutParameterBase>(Type.EmptyTypes, invocationHandler); StructType value; proxy.Method(out value); // Assert Assert.That(invocationHandler.Parameters[0], Is.EqualTo(new StructType {Integer = 2, String = "2"})); }
public void CreateProxyFromAbstractClassWithGenericRankArrayOutParameterTest() { // Arrange var invocationHandler = new SetParametersInvocationHandler {Parameters = new object[] {new[,] {{"Two", "Two"}}}}; // Act var proxy = _proxyFactory.CreateProxy<GenericRankArrayOutParameterBase>(Type.EmptyTypes, invocationHandler); string[,] value; proxy.Method(out value); // Assert Assert.That(invocationHandler.Parameters[0], Is.EqualTo(new[,] {{"Two", "Two"}})); }
public void CreateProxyFromInterfaceWithStringOutParameterTest() { // Arrange var invocationHandler = new SetParametersInvocationHandler {Parameters = new object[] {"2"}}; // Act var proxy = _proxyFactory.CreateProxy<IStringOutParameter>(Type.EmptyTypes, invocationHandler); string value; proxy.Method(out value); // Assert Assert.That(invocationHandler.Parameters[0], Is.EqualTo("2")); }
public void CreateProxyFromInterfaceWithGenericListOutParameterTest() { // Arrange var invocationHandler = new SetParametersInvocationHandler {Parameters = new object[] {new List<string> {"Two"}}}; // Act var proxy = _proxyFactory.CreateProxy<IGenericListOutParameter>(Type.EmptyTypes, invocationHandler); List<string> value; proxy.Method(out value); // Assert Assert.That(invocationHandler.Parameters[0], Is.EqualTo(new List<string> {"Two"})); }
public void CreateProxyFromClassWithIntOutParameterTest() { // Arrange var invocationHandler = new SetParametersInvocationHandler {Parameters = new object[] {2}}; // Act var proxy = _proxyFactory.CreateProxy<IntOutParameter>(Type.EmptyTypes, invocationHandler); int value; proxy.Method(out value); // Assert Assert.That(invocationHandler.Parameters[0], Is.EqualTo(2)); }