Пример #1
0
        public void TestGetXml()
        {
            using (RpcBroker broker = new RpcBroker("sdfsdf", 0))
            {
                MockCommand cmd = new MockCommand(broker);

                string xml = cmd.GetXmlDescription();

                Assert.IsTrue((!string.IsNullOrWhiteSpace(xml)), "Xml is Null or Whitespace");
            }
        }
Пример #2
0
        public void TestExecuteNotConnected()
        {
            using (RpcBroker broker = new RpcBroker("sdfsdf", 0))
            {
                MockCommand cmd = new MockCommand(broker);

                RpcResponse response = cmd.Execute();

                Assert.AreEqual("", response.Data);
                Assert.AreNotEqual("", response.InformationalMessage);
                Assert.AreEqual(RpcResponseFailType.NotConnected, response.FailType);
                Assert.AreEqual(RpcResponseStatus.Fail, response.Status);

                CollectionAssert.AreEqual(new string[0], response.Lines);
            }
        }
Пример #3
0
        public void TestExecute()
        {
            using (RpcBroker broker = new RpcBroker("", 9000))
            {
                if (broker.Connect())
                {
                    MockCommand cmd = new MockCommand(broker);

                    RpcResponse response = cmd.Execute();

                    Assert.AreEqual("", response.Data);
                    Assert.AreNotEqual("", response.InformationalMessage);
                    Assert.AreEqual(RpcResponseFailType.None, response.FailType);
                    Assert.AreEqual(RpcResponseStatus.Unknown, response.Status);

                    CollectionAssert.AreEqual(new string[0], response.Lines);

                    broker.Disconnect();
                }
            }
        }