示例#1
0
        public void TestMockIntroMsg_BadData()
        {
            IRpcBroker broker = MockRpcBrokerFactory.GetXusIntroMsgBroker(false);

            XusIntroMsgCommand testCommand = new XusIntroMsgCommand(broker);

            RpcResponse response = testCommand.Execute();

            // *** Check results ***
            Assert.IsNotNull(response);
            Assert.AreEqual(RpcResponseStatus.Fail, response.Status);
        }
示例#2
0
        public void TestMockIntroMsg_GoodData()
        {
            IRpcBroker broker = MockRpcBrokerFactory.GetXusIntroMsgBroker(true);

            XusIntroMsgCommand testCommand = new XusIntroMsgCommand(broker);

            RpcResponse response = testCommand.Execute();

            // *** Check results ***
            Assert.IsNotNull(response);
            Assert.AreEqual(RpcResponseStatus.Success, response.Status);
            Assert.IsFalse(string.IsNullOrWhiteSpace(response.Data));
        }
        public LoginResult GetLoginData()
        {
            // *** Get the login setup ***

            LoginResult returnVal = new LoginResult();

            if (this.broker != null)
            {
                // *** Signon Setup ***
                XusSignonSetupCommand setupCmd = new XusSignonSetupCommand(this.broker);
                setupCmd.Execute();

                // *** Check status ***
                if (setupCmd.Response.Status == RpcResponseStatus.Success)
                {
                    returnVal.LoginData.SetSignonSetup(setupCmd.SignonSetup);

                    // *** Get Intro Message ***
                    XusIntroMsgCommand cmdIntro = new XusIntroMsgCommand(this.broker);
                    cmdIntro.Execute();

                    // *** Check status ***
                    if (cmdIntro.Response.Status == RpcResponseStatus.Success)
                    {
                        // *** Set the login message ***
                        returnVal.LoginData.IntroMessage = cmdIntro.Response.Data;

                        returnVal.SetResult(true, "");
                    }
                    else
                    {
                        returnVal.LoginData.IntroMessage = cmdIntro.Response.InformationalMessage;
                        returnVal.SetResult(false, cmdIntro.Response.InformationalMessage);
                    }
                }
                else
                {
                    returnVal.SetResult(false, setupCmd.Response.InformationalMessage);
                }
            }
            else
            {
                returnVal.SetResult(false, "No Broker");
            }

            return(returnVal);
        }
        public void TestIntroMsg()
        {
            Queue <CommandBase> commandQueue = new Queue <CommandBase>();

            using (RpcBroker broker = GetConnectedBroker())
            {
                XusIntroMsgCommand testCommand = new XusIntroMsgCommand(broker);

                commandQueue.Enqueue(testCommand);

                RpcResponse response = ExecuteCommandQueue(commandQueue);

                // *** Check results ***
                Assert.AreEqual(RpcResponseStatus.Success, response.Status);
                Assert.IsFalse(string.IsNullOrWhiteSpace(response.Data));

                broker.Disconnect();
            }
        }