예제 #1
0
        public void ShallRaiseEventWithoutParameters(string serverAddress, string client1Address, string client2Address)
        {
            //Arrange
            var objectId = "obj";

            var hostedObject = new HostedObject();

            using (var server = new EloquentServer(serverAddress))
                using (var client1 = new EloquentClient(serverAddress, client1Address))
                    using (var client2 = new EloquentClient(serverAddress, client2Address))
                    {
                        server.Add <IContract>(objectId, hostedObject);

                        var remoteObject1 = client1.Connect <IContract>(objectId);
                        var remoteObject2 = client2.Connect <IContract>(objectId);

                        var noParameterEvent1Called = false;
                        var noParameterEvent2Called = false;

                        var autoResetEvent1 = new AutoResetEvent(false);
                        var autoResetEvent2 = new AutoResetEvent(false);

                        remoteObject1.NoParameterEvent += () =>
                        {
                            noParameterEvent1Called = true;
                            autoResetEvent1.Set();
                        };
                        remoteObject2.NoParameterEvent += () =>
                        {
                            noParameterEvent2Called = true;
                            autoResetEvent2.Set();
                        };

                        //Act
                        Assert.IsFalse(noParameterEvent1Called);
                        Assert.IsFalse(noParameterEvent2Called);
                        hostedObject.SendNoParametersEvent();

                        autoResetEvent1.WaitOne(2000);
                        autoResetEvent2.WaitOne(2000);

                        //Assert
                        Assert.IsTrue(noParameterEvent1Called);

                        //TODO: Failed during long run
                        Assert.IsTrue(noParameterEvent2Called);
                    }
        }
예제 #2
0
        public void ShallRaiseExceptionForGetters(string serverAddress, string clientAddress)
        {
            //Arrange
            var objectId = "obj";

            var hostedObject = new HostedObject();

            using (var server = new EloquentServer(serverAddress))
                using (var client = new EloquentClient(serverAddress, clientAddress))
                {
                    server.Add <IContract>(objectId, hostedObject);

                    var remoteObject = client.Connect <IContract>(objectId);
                    hostedObject.Value  = 5;
                    hostedObject.Action = () => throw new InvalidOperationException("qwerty");

                    //Act
                    int val       = 0;
                    var exception = Assert.Catch <FaultException>(() => { val = remoteObject.Get; });
                    //Assert
                    Assert.AreEqual(0, val);
                    Assert.AreEqual("qwerty", exception.Message);
                    Assert.AreEqual(typeof(InvalidOperationException).FullName, exception.ExceptionType);

                    //Act
                    exception = Assert.Catch <FaultException>(() => { val = remoteObject.GetSet; });
                    //Assert
                    Assert.AreEqual(0, val);
                    Assert.AreEqual("qwerty", exception.Message);
                    Assert.AreEqual(typeof(InvalidOperationException).FullName, exception.ExceptionType);

                    //Act
                    exception = Assert.Catch <FaultException>(() => { val = remoteObject.OneWayGetSet; });
                    //Assert
                    Assert.AreEqual(0, val);
                    Assert.AreEqual("qwerty", exception.Message);
                    Assert.AreEqual(typeof(InvalidOperationException).FullName, exception.ExceptionType);

                    //Act
                    ComplexParameter complex = null;
                    exception = Assert.Catch <FaultException>(() => { complex = remoteObject.ComplexGetSet; });
                    //Assert
                    Assert.AreEqual(null, complex);
                    Assert.AreEqual("qwerty", exception.Message);
                    Assert.AreEqual(typeof(InvalidOperationException).FullName, exception.ExceptionType);
                }
        }
        public void ShallReturnConnectableEloquentObject(string serverAddress, string clientAddress)
        {
            //Arrange
            using (var server = new EloquentServer(serverAddress))
                using (var child = new ChildObject(server, "child", "qwerty"))
                    using (new ParentObject(server, "parent", child))
                        using (var client = new EloquentClient(serverAddress, clientAddress))
                        {
                            //Arrange
                            var remoteParent = client.Connect <IContract>("parent");

                            //Act
                            var remoteChild = remoteParent.GetChild();

                            //Assert
                            Assert.AreEqual("qwerty", remoteChild.Name);
                        }
        }
예제 #4
0
        public void ShallThrowWhenCalledRemovedObject(string serverAddress, string client1Address)
        {
            //Arrange
            using (var server = new EloquentServer(serverAddress))
                using (var client = new EloquentClient(serverAddress, client1Address))
                {
                    var objectHost = server.Add <IContract>("objectId", new HostedObject());

                    var remoteObject = client.Connect <IContract>("objectId");
                    objectHost.Dispose();

                    //Act
                    var exception = Assert.Catch <Exception>(() => { remoteObject.Value = 5; });

                    //Assert
                    Assert.AreEqual("Object with id 'objectId' is not hosted on server.", exception.Message);
                }
        }
예제 #5
0
        public MeasurementResult Measure()
        {
            using (var remoteObjectServer = new EloquentServer($"{_scheme}://127.0.0.1:50000"))
                using (var remoteObjectClient = new EloquentClient($"{_scheme}://127.0.0.1:50000", $"{_scheme}://127.0.0.1:50001"))
                {
                    remoteObjectServer.Add <IBenchmarkObject>("endpoint1", new BenchmarkObject());

                    var benchmarkObj = remoteObjectClient.Connect <IBenchmarkObject>("endpoint1");

                    return(MeasurementResult.Measure($"EloquentObjects: One-way calls with {_scheme}", () =>
                    {
                        for (var i = 0; i < _iterations; i++)
                        {
                            benchmarkObj.OneWayCall();
                        }
                    }));
                }
        }
예제 #6
0
        public void ShallHostAgain(string serverAddress, string clientAddress)
        {
            //Arrange
            var objectId = "obj";

            var hostedObject = new HostedObject();

            using (var server = new EloquentServer(serverAddress))
            {
                server.Add <IContract>(objectId, hostedObject);

                using (var client = new EloquentClient(serverAddress, clientAddress))
                {
                    var remoteObject = client.Connect <IContract>(objectId);

                    //Act
                    remoteObject.Value = 5;

                    //Assert
                    Assert.AreEqual(5, remoteObject.Value);
                }
            }

            using (var server = new EloquentServer(serverAddress))
            {
                server.Add <IContract>(objectId, hostedObject);

                using (var client = new EloquentClient(serverAddress, clientAddress))
                {
                    var remoteObject = client.Connect <IContract>(objectId);

                    //Assert
                    Assert.AreEqual(5, remoteObject.Value);

                    //Act
                    remoteObject.Value = 6;

                    //Assert
                    Assert.AreEqual(6, remoteObject.Value);
                }
            }
        }
예제 #7
0
        public void ShallThrowWhenConnectingToStoppedServer(string serverAddress, string client1Address)
        {
            //Arrange
            var server = new EloquentServer(serverAddress);

            using (var client = new EloquentClient(serverAddress, client1Address))
            {
                server.Dispose();

                //Act
                var exception = Assert.Catch <Exception>(() => { client.Connect <IContract>("objectId"); });

                //Assert
                if (exception is FaultException)
                {
                    Assert.IsInstanceOf <IOException>(exception);
                }
                Assert.AreEqual("Connection failed. Check that server is still alive", exception.Message);
            }
        }
예제 #8
0
        public void ShallCallRemoteMethodsTwoWay(string serverAddress, string clientAddress)
        {
            //Arrange
            var objectId = "obj";

            var hostedObject = new HostedObject();

            using (var server = new EloquentServer(serverAddress))
                using (var client = new EloquentClient(serverAddress, clientAddress))
                {
                    server.Add <IContract>(objectId, hostedObject);

                    var remoteObject = client.Connect <IContract>(objectId);

                    Assert.IsFalse(hostedObject.TwoWayCalled);

                    //Act
                    remoteObject.CallTwoWay();

                    //Assert
                    Assert.IsTrue(hostedObject.TwoWayCalled);
                }
        }
예제 #9
0
        public void ShallHideExceptionWhenCalledRemoteMethodsOneWay(string serverAddress, string clientAddress)
        {
            //Arrange
            var objectId = "obj";

            var hostedObject = new HostedObject();

            using (var server = new EloquentServer(serverAddress))
                using (var client = new EloquentClient(serverAddress, clientAddress))
                {
                    server.Add <IContract>(objectId, hostedObject);

                    var remoteObject = client.Connect <IContract>(objectId);

                    Assert.IsFalse(hostedObject.OneWayWithExceptionCalled);

                    //Act
                    remoteObject.CallOneWayWithException();
                    hostedObject.WaitCallCompleted();

                    //Assert
                    Assert.IsTrue(hostedObject.OneWayWithExceptionCalled);
                }
        }
        public MeasurementResult Measure()
        {
            using (var remoteObjectServer = new EloquentServer($"{_scheme}://127.0.0.1:50000"))
                using (var remoteObjectClient = new EloquentClient($"{_scheme}://127.0.0.1:50000", $"{_scheme}://127.0.0.1:50001"))
                {
                    remoteObjectServer.Add <IBenchmarkObject>("endpoint1", new BenchmarkObject());

                    var benchmarkObj = remoteObjectClient.Connect <IBenchmarkObject>("endpoint1");

                    var parameter = new Parameter
                    {
                        Parameter1 = new InnerParameter1
                        {
                            Parameter2 = new InnerParameter2
                            {
                                Parameter3 = new InnerParameter3
                                {
                                    IntValue    = 123,
                                    BoolValue   = false,
                                    DoubleValue = 123.123,
                                    StringValue = "123"
                                }
                            }
                        }
                    };

                    return(MeasurementResult.Measure($"EloquentObjects.Proto: One-way calls with parameter with {_scheme}",
                                                     () =>
                    {
                        for (var i = 0; i < _iterations; i++)
                        {
                            benchmarkObj.OneWayCallWithParameter(parameter);
                        }
                    }));
                }
        }
예제 #11
0
        public void ShallPassRemoteObjectAsParameter(string serverAddress, string clientAddress)
        {
            //Arrange
            var parent = new Parent();
            var child  = new Child();

            using (var server = new EloquentServer(serverAddress))
                using (var client = new EloquentClient(serverAddress, clientAddress))
                {
                    server.Add <IParent>("parent", parent);
                    server.Add <IChild>("child", child);

                    var remoteParent = client.Connect <IParent>("parent");
                    var remoteChild  = client.Connect <IChild>("child");

                    parent.Value = null;

                    //Act
                    remoteParent.SetChild1(remoteChild);
                    //Assert
                    Assert.AreEqual(0, parent.A);
                    Assert.AreEqual(null, parent.B);
                    Assert.AreSame(child, parent.Value);

                    parent.Value = null;

                    //Act
                    remoteParent.SetChild2(5, remoteChild);
                    //Assert
                    Assert.AreEqual(5, parent.A);
                    Assert.AreEqual(null, parent.B);
                    Assert.AreSame(child, parent.Value);

                    parent.Value = null;

                    //Act
                    remoteParent.SetChild3(7, remoteChild, "qwerty");
                    //Assert
                    Assert.AreEqual(7, parent.A);
                    Assert.AreEqual("qwerty", parent.B);
                    Assert.AreSame(child, parent.Value);

                    parent.Value = null;

                    //Act
                    remoteParent.SetChild4(remoteChild);
                    parent.WaitNotificationReceived();
                    //Assert
                    Assert.AreEqual(7, parent.A);
                    Assert.AreEqual("qwerty", parent.B);
                    Assert.AreSame(child, parent.Value);

                    parent.Value = null;

                    //Act
                    remoteParent.SetChild5(5, remoteChild);
                    parent.WaitNotificationReceived();
                    //Assert
                    Assert.AreEqual(5, parent.A);
                    Assert.AreEqual("qwerty", parent.B);
                    Assert.AreSame(child, parent.Value);

                    parent.Value = null;

                    //Act
                    remoteParent.SetChild6(0, remoteChild, null);
                    parent.WaitNotificationReceived();
                    //Assert
                    Assert.AreEqual(0, parent.A);
                    Assert.AreEqual(null, parent.B);
                    Assert.AreSame(child, parent.Value);

                    parent.Value = null;
                }
        }
예제 #12
0
        public void ShallSetValuesForProperties(string serverAddress, string clientAddress)
        {
            //Arrange
            var objectId = "obj";

            var hostedObject = new HostedObject();

            using (var server = new EloquentServer(serverAddress))
                using (var client = new EloquentClient(serverAddress, clientAddress))
                {
                    server.Add <IContract>(objectId, hostedObject);

                    var remoteObject = client.Connect <IContract>(objectId);

                    var complexParameter = new ComplexParameter
                    {
                        A = 2,
                        B = false,
                        D = 234.234,
                        S = "asd"
                    };
                    hostedObject.ComplexValue = complexParameter;

                    Assert.AreEqual(0, hostedObject.Value);
                    AssertComplexParameter(complexParameter, hostedObject.ComplexValue);

                    //Act
                    remoteObject.Set = 5;
                    //Assert
                    Assert.AreEqual(5, hostedObject.Value);

                    //Act
                    remoteObject.OneWaySet = 7;
                    hostedObject.WaitSet();
                    //Assert
                    Assert.AreEqual(7, hostedObject.Value);

                    //Act
                    remoteObject.OneWayGetSet = 9;
                    hostedObject.WaitSet();
                    //Assert
                    Assert.AreEqual(9, hostedObject.Value);

                    //Act
                    remoteObject.GetSet = 11;
                    //Assert
                    Assert.AreEqual(11, hostedObject.Value);

                    //Act
                    var complexParameter2 = new ComplexParameter
                    {
                        A = 1,
                        B = true,
                        D = 123.123,
                        S = "qwerty"
                    };
                    remoteObject.ComplexGetSet = complexParameter2;
                    //Assert
                    AssertComplexParameter(complexParameter2, hostedObject.ComplexValue);
                }
        }
예제 #13
0
        public void ShallRaiseRegularEventWithClientAsSender(string serverAddress, string client1Address,
                                                             string client2Address)
        {
            //Arrange
            var objectId = "obj";

            var hostedObject = new HostedObject();

            using (var server = new EloquentServer(serverAddress))
                using (var client1 = new EloquentClient(serverAddress, client1Address))
                    using (var client2 = new EloquentClient(serverAddress, client2Address))
                    {
                        server.Add <IContract>(objectId, hostedObject);

                        var remoteObject1 = client1.Connect <IContract>(objectId);
                        var remoteObject2 = client2.Connect <IContract>(objectId);
                        var remoteObject3 = client2.Connect <IContract>(objectId);
                        Assert.AreNotSame(remoteObject1, remoteObject2);
                        Assert.AreNotSame(remoteObject2, remoteObject3);

                        object           sender1 = null;
                        object           sender2 = null;
                        object           sender3 = null;
                        object           sender4 = null;
                        ComplexParameter args1   = null;
                        ComplexParameter args2   = null;
                        ComplexParameter args3   = null;
                        ComplexParameter args4   = null;

                        var autoResetEvent1 = new AutoResetEvent(false);
                        var autoResetEvent2 = new AutoResetEvent(false);
                        var autoResetEvent3 = new AutoResetEvent(false);
                        var autoResetEvent4 = new AutoResetEvent(false);

                        remoteObject1.RegularEvent += (s, args) =>
                        {
                            sender1 = s;
                            args1   = args;
                            autoResetEvent1.Set();
                        };
                        remoteObject2.RegularEvent += (s, args) =>
                        {
                            sender2 = s;
                            args2   = args;
                            autoResetEvent2.Set();
                        };
                        remoteObject3.RegularEvent += (s, args) =>
                        {
                            sender3 = s;
                            args3   = args;
                            autoResetEvent3.Set();
                        };
                        remoteObject3.RegularEvent += (s, args) =>
                        {
                            sender4 = s;
                            args4   = args;
                            autoResetEvent4.Set();
                        };

                        var complexParameter1 = new ComplexParameter
                        {
                            A = 5,
                            B = true,
                            D = 543.543,
                            S = "asd"
                        };

                        Assert.IsNull(sender1);
                        Assert.IsNull(sender2);
                        Assert.IsNull(sender3);
                        Assert.IsNull(sender4);
                        Assert.IsNull(args1);
                        Assert.IsNull(args2);
                        Assert.IsNull(args3);
                        Assert.IsNull(args4);

                        //Act
                        hostedObject.SendRegularEvent(complexParameter1);

                        autoResetEvent1.WaitOne(2000);
                        autoResetEvent2.WaitOne(2000);
                        autoResetEvent3.WaitOne(2000);
                        autoResetEvent4.WaitOne(2000);

                        //Assert
                        Assert.AreSame(remoteObject1, sender1);
                        Assert.AreSame(remoteObject2, sender2);
                        Assert.AreSame(remoteObject3, sender3);
                        Assert.AreSame(remoteObject3, sender4);
                        AssertComplexParameter(complexParameter1, args1);
                        AssertComplexParameter(complexParameter1, args2);
                        AssertComplexParameter(complexParameter1, args3);
                        AssertComplexParameter(complexParameter1, args4);
                    }
        }
예제 #14
0
        public void ShallRaiseEventWithParameters(string serverAddress, string client1Address, string client2Address)
        {
            //Arrange
            var objectId = "obj";

            var hostedObject = new HostedObject();

            using (var server = new EloquentServer(serverAddress))
                using (var client1 = new EloquentClient(serverAddress, client1Address))
                    using (var client2 = new EloquentClient(serverAddress, client2Address))
                    {
                        server.Add <IContract>(objectId, hostedObject);

                        var remoteObject1 = client1.Connect <IContract>(objectId);
                        var remoteObject2 = client2.Connect <IContract>(objectId);

                        object[] parameters1 = null;
                        object[] parameters2 = null;

                        var autoResetEvent1 = new AutoResetEvent(false);
                        var autoResetEvent2 = new AutoResetEvent(false);

                        remoteObject1.EventWithParameters += (i, b, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10) =>
                        {
                            parameters1 = new object[]
                            {
                                i, b, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10
                            };

                            autoResetEvent1.Set();
                        };

                        remoteObject2.EventWithParameters += (i, b, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10) =>
                        {
                            parameters2 = new object[]
                            {
                                i, b, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10
                            };

                            autoResetEvent2.Set();
                        };

                        //Act
                        Assert.IsNull(parameters1);
                        Assert.IsNull(parameters2);

                        //Act
                        var complexParameter1 = new ComplexParameter
                        {
                            A = 5,
                            B = true,
                            D = 543.543,
                            S = "asd"
                        };
                        var complexParameter2 = new ComplexParameter
                        {
                            A = 6,
                            B = false,
                            D = 345.345,
                            S = "zxc"
                        };
                        var complexParameter3 = new ComplexParameter
                        {
                            A = 5,
                            B = true,
                            D = 543.543,
                            S = "123"
                        };

                        hostedObject.SendEventWithParameters(
                            1,
                            false,
                            "qwerty",
                            123.123,
                            complexParameter1,
                            new[] { 1, 2, 3 },
                            new[] { false, true, false },
                            new[] { "123", "qwe", "zxc" },
                            new[] { 1.123, 2.234, 3.345 },
                            new[]
                        {
                            complexParameter2,
                            complexParameter3,
                        });

                        autoResetEvent1.WaitOne(2000);
                        autoResetEvent2.WaitOne(2000);

                        Assert.NotNull(parameters1);
                        Assert.NotNull(parameters2);

                        Assert.AreEqual(1, parameters1[0]);
                        Assert.AreEqual(false, parameters1[1]);
                        Assert.AreEqual("qwerty", parameters1[2]);
                        Assert.AreEqual(123.123, parameters1[3]);
                        AssertComplexParameter(complexParameter1, (ComplexParameter)parameters1[4]);
                        Assert.AreEqual(new[] { 1, 2, 3 }, parameters1[5]);
                        Assert.AreEqual(new[] { false, true, false }, parameters1[6]);
                        Assert.AreEqual(new[] { "123", "qwe", "zxc" }, parameters1[7]);
                        Assert.AreEqual(new[] { 1.123, 2.234, 3.345 }, parameters1[8]);
                        Assert.AreEqual(2, ((ComplexParameter[])parameters1[9]).Length);
                        AssertComplexParameter(complexParameter2, ((ComplexParameter[])parameters1[9])[0]);
                        AssertComplexParameter(complexParameter3, ((ComplexParameter[])parameters1[9])[1]);


                        Assert.AreEqual(1, parameters2[0]);
                        Assert.AreEqual(false, parameters2[1]);
                        Assert.AreEqual("qwerty", parameters2[2]);
                        Assert.AreEqual(123.123, parameters2[3]);
                        AssertComplexParameter(complexParameter1, (ComplexParameter)parameters2[4]);
                        Assert.AreEqual(new[] { 1, 2, 3 }, parameters2[5]);
                        Assert.AreEqual(new[] { false, true, false }, parameters2[6]);
                        Assert.AreEqual(new[] { "123", "qwe", "zxc" }, parameters2[7]);
                        Assert.AreEqual(new[] { 1.123, 2.234, 3.345 }, parameters2[8]);
                        Assert.AreEqual(2, ((ComplexParameter[])parameters2[9]).Length);
                        AssertComplexParameter(complexParameter2, ((ComplexParameter[])parameters2[9])[0]);
                        AssertComplexParameter(complexParameter3, ((ComplexParameter[])parameters2[9])[1]);
                    }
        }
예제 #15
0
 public ProtoEloquentServer(string address)
 {
     _eloquentServer = new EloquentServer(address);
 }
예제 #16
0
 public ProtoEloquentServer(string address, EloquentSettings settings)
 {
     _eloquentServer = new EloquentServer(address, settings);
 }
예제 #17
0
        public void ShallCallRemoteMethodsOneWayWithParameters(string serverAddress, string clientAddress)
        {
            //Arrange
            var objectId = "obj";

            var hostedObject = new HostedObject();

            using (var server = new EloquentServer(serverAddress))
                using (var client = new EloquentClient(serverAddress, clientAddress))
                {
                    server.Add <IContract>(objectId, hostedObject);

                    var remoteObject = client.Connect <IContract>(objectId);

                    Assert.IsFalse(hostedObject.OneWayWithParameterCalled);

                    //Act
                    var complexParameter1 = new ComplexParameter
                    {
                        A = 5,
                        B = true,
                        D = 543.543,
                        S = "asd"
                    };
                    var complexParameter2 = new ComplexParameter
                    {
                        A = 6,
                        B = false,
                        D = 345.345,
                        S = "zxc"
                    };
                    var complexParameter3 = new ComplexParameter
                    {
                        A = 5,
                        B = true,
                        D = 543.543,
                        S = "123"
                    };

                    remoteObject.CallOneWayWithParameters(
                        1,
                        false,
                        "qwerty",
                        123.123,
                        complexParameter1,
                        new[] { 1, 2, 3 },
                        new[] { false, true, false },
                        new[] { "123", "qwe", "zxc" },
                        new[] { 1.123, 2.234, 3.345 },
                        new[]
                    {
                        complexParameter2,
                        complexParameter3,
                    });
                    hostedObject.WaitCallCompleted();

                    //Assert
                    Assert.IsTrue(hostedObject.OneWayWithParameterCalled);

                    Assert.AreEqual(1, hostedObject.Parameters[0]);
                    Assert.AreEqual(false, hostedObject.Parameters[1]);
                    Assert.AreEqual("qwerty", hostedObject.Parameters[2]);
                    Assert.AreEqual(123.123, hostedObject.Parameters[3]);
                    AssertComplexParameter(complexParameter1, (ComplexParameter)hostedObject.Parameters[4]);
                    Assert.AreEqual(new[] { 1, 2, 3 }, hostedObject.Parameters[5]);
                    Assert.AreEqual(new[] { false, true, false }, hostedObject.Parameters[6]);
                    Assert.AreEqual(new[] { "123", "qwe", "zxc" }, hostedObject.Parameters[7]);
                    Assert.AreEqual(new[] { 1.123, 2.234, 3.345 }, hostedObject.Parameters[8]);
                    Assert.AreEqual(2, ((ComplexParameter[])hostedObject.Parameters[9]).Length);
                    AssertComplexParameter(complexParameter2, ((ComplexParameter[])hostedObject.Parameters[9])[0]);
                    AssertComplexParameter(complexParameter3, ((ComplexParameter[])hostedObject.Parameters[9])[1]);

                    //Act
                    hostedObject.OneWayWithParameterCalled = false;
                    hostedObject.Parameters = null;

                    Assert.IsFalse(hostedObject.OneWayWithParameterCalled);

                    remoteObject.CallOneWayWithParameters(
                        2,
                        true,
                        null,
                        234.234,
                        null,
                        null,
                        null,
                        null,
                        null,
                        null);
                    hostedObject.WaitCallCompleted();

                    //Assert
                    Assert.IsTrue(hostedObject.OneWayWithParameterCalled);

                    Assert.AreEqual(2, hostedObject.Parameters[0]);
                    Assert.AreEqual(true, hostedObject.Parameters[1]);
                    Assert.AreEqual(null, hostedObject.Parameters[2]);
                    Assert.AreEqual(234.234, hostedObject.Parameters[3]);
                    Assert.AreEqual(null, hostedObject.Parameters[4]);
                    Assert.AreEqual(null, hostedObject.Parameters[5]);
                    Assert.AreEqual(null, hostedObject.Parameters[6]);
                    Assert.AreEqual(null, hostedObject.Parameters[7]);
                }
        }