Esempio n. 1
0
        public void TestMethod1()
        {
            var server = new ISCommServer();
            var client = new ISCommClient();

            server.Start(4545);

            BaseMessage dm = new EchoMessage();

            client.Connect("localhost", 4545);

            var em = new EchoMessage();

            em.EchoText = "Hallo";

            this.mrep.Reset();
            client.ObjectReceived += this.ClientObjectReceived;
            client.Send(em);

            this.mrep.WaitOne();

            Assert.IsNotNull(this.reply);
            Assert.IsAssignableFrom <AnswerMessage>(this.reply);
            Assert.AreEqual(((AnswerMessage)this.reply).Echo, em.EchoText);
            server.Stop();
        }
Esempio n. 2
0
        public void OutSideMessageClassTest()
        {
            var server = new ISCommServer();
            var client = new ISCommClient();

            server.Start(4343);
            this.mrep.Reset();
            client.ObjectReceived += this.client_ObjectReceived;
            client.Connect("localhost", server.Port);

            client.Send(new DerivedTest());

            this.mrep.WaitOne();
            Assert.IsTrue((this.reply is AnswerMessage) && (((AnswerMessage)this.reply).Echo == "Derived"));
        }
Esempio n. 3
0
        public void Test1()
        {
            var server = new ISCommServer();
            var client = new ISCommClient(-1, -1, false);

            server.Start(4545);

            client.Connect("localhost", 4545);
            client.ObjectReceived += this.client_ObjectReceived;

            var em = new EchoMessage();

            em.EchoText = "Hallo";

            mrep.Reset();

            client.Send(em);
            mrep.WaitOne();

            Assert.IsNotNull(this.reply);
            Assert.IsInstanceOf <AnswerMessage>(this.reply);
        }