コード例 #1
0
        // DESCRIPTION:
        // * Tests the numMixer object with the passed state.
        // * Pings the numMixer and prints returned values, if it succeeds.
        //
        // PRECONDITIONS:
        // * numMixerObj must not be null.
        // * numMixerObj must have a dataset containing the requested parity.
        //
        // POSTCONDITIONS:
        // * numMixer may no longer be active.


        static void testParity(numMixer numMixerObj,
                               numMixer.OutputController parity,
                               ref StreamWriter sw)
        {
            if (parity == numMixerObj.getControllerState())
            {
                writeHeader("PING " + numMixerObj.getControllerStateName(), ref sw);
                sw.WriteLine("State change failed (already set).");
            }
            else
            {
                numMixerObj.setControllerState(parity);
                writeHeader("PING " + numMixerObj.getControllerStateName(), ref sw);
                sw.WriteLine("State set to {0}.", numMixerObj.getControllerStateName());
            }
        }