public void TestQuery()
        {
            var session = new MockTaskSession();

            session.VerifyStart();

            session.VerifyCommand(() => session.Query(QueryType.BindPluName), "Query(BindPluName)");

            Assert.AreEqual(session.Query(QueryType.Cursor).Result[0], "0 0");

            // Force an exception.
            session.ExceptionMode = true;
            session.AllFail       = true;
            Assert.Throws <X3270ifCommandException>(() => session.Query(QueryType.Formatted));

            session.Close();

            // Exercise 1-origin.
            session = new MockTaskSession(new MockTaskConfig {
                Origin = 1
            });
            session.Start();
            Assert.AreEqual(session.Query(QueryType.Cursor).Result[0], "1 1");

            // Make sure the history contains the actual value from the emulator.
            Assert.AreEqual(session.RecentCommands[0].Result[0], "0 0");

            session.Close();
        }