Exemplo n.º 1
0
        public void CreateProxyFromAbstractClassWithStructRefParameterTest()
        {
            // Arrange
            var invocationHandler = new GetParametersInvocationHandler();

            // Act
            var proxy = _proxyFactory.CreateProxy<StructRefParameterBase>(Type.EmptyTypes, invocationHandler);
            var value = new StructType {Integer = 2, String = "2"};

            proxy.Method(ref value);

            // Assert
            Assert.That(invocationHandler.Parameters[0], Is.EqualTo(new StructType {Integer = 2, String = "2"}));
        }
Exemplo n.º 2
0
        public void CreateProxyFromAbstractClassWithGenericRefParameterTest()
        {
            // Arrange
            var invocationHandler = new GetParametersInvocationHandler();

            // Act
            var proxy = _proxyFactory.CreateProxy<GenericRefParameterBase>(Type.EmptyTypes, invocationHandler);
            var value = "Two";

            proxy.Method(ref value);

            // Assert
            Assert.That(invocationHandler.Parameters[0], Is.EqualTo("Two"));
        }
Exemplo n.º 3
0
        public void CreateProxyFromAbstractClassWithStringParameterTest()
        {
            // Arrange
            var invocationHandler = new GetParametersInvocationHandler();

            // Act
            var proxy = _proxyFactory.CreateProxy<StringParameterBase>(Type.EmptyTypes, invocationHandler);

            proxy.Method("2");

            // Assert
            Assert.That(invocationHandler.Parameters[0], Is.EqualTo("2"));
        }
Exemplo n.º 4
0
        public void CreateProxyFromInterfaceWithStructParameterTest()
        {
            // Arrange
            var invocationHandler = new GetParametersInvocationHandler();

            // Act
            var proxy = _proxyFactory.CreateProxy<IStructParameter>(Type.EmptyTypes, invocationHandler);

            proxy.Method(new StructType {Integer = 2, String = "2"});

            // Assert
            Assert.That(invocationHandler.Parameters[0], Is.EqualTo(new StructType {Integer = 2, String = "2"}));
        }
Exemplo n.º 5
0
        public void CreateProxyFromAbstractClassWithGenericRankArrayParameterTest()
        {
            // Arrange
            var invocationHandler = new GetParametersInvocationHandler();

            // Act
            var proxy = _proxyFactory.CreateProxy<GenericRankArrayParameterBase>(Type.EmptyTypes, invocationHandler);

            proxy.Method(new[,] {{"Two", "Two"}});

            // Assert
            Assert.That(invocationHandler.Parameters[0], Is.EqualTo(new[,] {{"Two", "Two"}}));
        }
Exemplo n.º 6
0
        public void CreateProxyFromInterfaceWithIntParameterTest()
        {
            // Arrange
            var invocationHandler = new GetParametersInvocationHandler();

            // Act
            var proxy = _proxyFactory.CreateProxy<IIntParameter>(Type.EmptyTypes, invocationHandler);

            proxy.Method(2);

            // Assert
            Assert.That(invocationHandler.Parameters[0], Is.EqualTo(2));
        }
Exemplo n.º 7
0
        public void CreateProxyFromInterfaceWithStringRefParameterTest()
        {
            // Arrange
            var invocationHandler = new GetParametersInvocationHandler();

            // Act
            var proxy = _proxyFactory.CreateProxy<IStringRefParameter>(Type.EmptyTypes, invocationHandler);
            var value = "2";

            proxy.Method(ref value);

            // Assert
            Assert.That(invocationHandler.Parameters[0], Is.EqualTo("2"));
        }
Exemplo n.º 8
0
        public void CreateProxyFromInterfaceWithGenericListParameterTest()
        {
            // Arrange
            var invocationHandler = new GetParametersInvocationHandler();

            // Act
            var proxy = _proxyFactory.CreateProxy<IGenericListParameter>(Type.EmptyTypes, invocationHandler);

            proxy.Method(new List<string> {"Two"});

            // Assert
            Assert.That(invocationHandler.Parameters[0], Is.EqualTo(new List<string> {"Two"}));
        }
Exemplo n.º 9
0
        public void CreateProxyFromInterfaceWithGenericRankArrayRefParameterTest()
        {
            // Arrange
            var invocationHandler = new GetParametersInvocationHandler();

            // Act
            var proxy = _proxyFactory.CreateProxy<IGenericRankArrayRefParameter>(Type.EmptyTypes, invocationHandler);
            var value = new[,] {{"Two", "Two"}};

            proxy.Method(ref value);

            // Assert
            Assert.That(invocationHandler.Parameters[0], Is.EqualTo(new[,] {{"Two", "Two"}}));
        }
Exemplo n.º 10
0
        public void CreateProxyFromDelegateWithStructArrayParameterTest()
        {
            // Arrange
            var invocationHandler = new GetParametersInvocationHandler();

            // Act
            var proxy = _proxyFactory.CreateProxy<Action<StructType[]>>(Type.EmptyTypes, invocationHandler);

            proxy(new[] {new StructType {Integer = 2, String = "2"}});

            // Assert
            Assert.That(invocationHandler.Parameters[0], Is.EqualTo(new[] {new StructType {Integer = 2, String = "2"}}));
        }
Exemplo n.º 11
0
        public void CreateProxyFromDelegateWithStringParameterTest()
        {
            // Arrange
            var invocationHandler = new GetParametersInvocationHandler();

            // Act
            var proxy = _proxyFactory.CreateProxy<Action<string>>(Type.EmptyTypes, invocationHandler);

            proxy("2");

            // Assert
            Assert.That(invocationHandler.Parameters[0], Is.EqualTo("2"));
        }
Exemplo n.º 12
0
        public void CreateProxyFromDelegateWithEnumArrayParameterTest()
        {
            // Arrange
            var invocationHandler = new GetParametersInvocationHandler();

            // Act
            var proxy = _proxyFactory.CreateProxy<Action<EnumType[]>>(Type.EmptyTypes, invocationHandler);

            proxy(new[] {EnumType.Two});

            // Assert
            Assert.That(invocationHandler.Parameters[0], Is.EqualTo(new[] {EnumType.Two}));
        }
Exemplo n.º 13
0
        public void CreateProxyFromClassWithStringArrayRefParameterTest()
        {
            // Arrange
            var invocationHandler = new GetParametersInvocationHandler();

            // Act
            var proxy = _proxyFactory.CreateProxy<StringArrayRefParameter>(Type.EmptyTypes, invocationHandler);
            var value = new[] {"2"};

            proxy.Method(ref value);

            // Assert
            Assert.That(invocationHandler.Parameters[0], Is.EqualTo(new[] {"2"}));
        }
Exemplo n.º 14
0
        public void CreateProxyFromClassWithGenericParameterTest()
        {
            // Arrange
            var invocationHandler = new GetParametersInvocationHandler();

            // Act
            var proxy = _proxyFactory.CreateProxy<GenericParameter>(Type.EmptyTypes, invocationHandler);

            proxy.Method("Two");

            // Assert
            Assert.That(invocationHandler.Parameters[0], Is.EqualTo("Two"));
        }