Example #1
0
        public void TestMockDivisionGet_BadData()
        {
            IRpcBroker mockBroker = MockRpcBrokerFactory.GetXusDivisionGetBroker(false);

            XusDivisionGetCommand divCommand = new XusDivisionGetCommand(mockBroker);

            RpcResponse response = divCommand.Execute();

            Assert.IsNotNull(response);
            Assert.AreEqual(RpcResponseStatus.Fail, response.Status);
        }
Example #2
0
        public void TestMockDivisionGet_GoodData()
        {
            IRpcBroker mockBroker = MockRpcBrokerFactory.GetXusDivisionGetBroker(true);

            XusDivisionGetCommand divCommand = new XusDivisionGetCommand(mockBroker);

            RpcResponse response = divCommand.Execute();

            Assert.IsNotNull(response);
            Assert.AreEqual(RpcResponseStatus.Success, response.Status);
            Assert.IsNotNull(divCommand.Divisions, "No divisions found");
        }
Example #3
0
        public void TestDivisionGet()
        {
            using (RpcBroker broker = GetConnectedBroker())
            {
                this.SignonToBroker(broker, 2);

                XusDivisionGetCommand command = new XusDivisionGetCommand(broker);

                RpcResponse response = command.Execute();

                Assert.IsNotNull(response);
                Assert.AreEqual(RpcResponseStatus.Success, response.Status);
                Assert.IsNotNull(command.Divisions, "No divisions found");
            }
        }
        public DivisionResult GetList()
        {
            DivisionResult returnResult = new DivisionResult();

            if (this.broker != null)
            {
                XusDivisionGetCommand divisionCommand = new XusDivisionGetCommand(this.broker);
                divisionCommand.Execute();

                bool success = (divisionCommand.Response.Status == RpcResponseStatus.Success);

                returnResult.SetResult(success, divisionCommand.Response.InformationalMessage);

                if (success)
                {
                    returnResult.Divisions = divisionCommand.Divisions;
                }
            }

            return(returnResult);
        }
        public void TestDivisionGet()
        {
            //RpcResponse response;
            //XusDivisionGetCommand divCommand;

            //Queue<CommandBase> commandQueue = new Queue<CommandBase>();

            //using (RpcBroker broker = GetConnectedBroker())
            //{
            //    commandQueue.Enqueue(new XusSignonSetupCommand(broker));

            //    XusAvCodeCommand avCommand = new XusAvCodeCommand(broker);
            //    avCommand.AddCommandArguments(ValidAccessCodes[0], ValidVerifyCodes[0]);

            //    commandQueue.Enqueue(avCommand);

            //    divCommand = new XusDivisionGetCommand(broker);

            //    commandQueue.Enqueue(divCommand);

            //    response = ExecuteCommandQueue(commandQueue);

            //    broker.Disconnect();
            //}

            using (RpcBroker broker = GetConnectedBroker())
            {
                this.SignonToBroker(broker, 2);

                XusDivisionGetCommand command = new XusDivisionGetCommand(broker);

                RpcResponse response = command.Execute();

                Assert.IsNotNull(response);
                Assert.AreEqual(RpcResponseStatus.Success, response.Status);
                Assert.IsNotNull(command.Divisions, "No divisions found");
            }
        }