FirmataRequestMessageFormatter.cs Unit Tests

The group of FirmataRequestMessageFormatter methods do not perform any sort of parameter validation because it is intended to be used for future versions of the Arduino board which may have different capabilities (and we already know that some do). Therefore, we do not need to test the parameter validation; we only need to test that the methods function as expected.

A line through the test indicates that it has been written and checked in to the source repository.

GenerateReportAnalogPinRequest(int pinNumber, bool enable) - Requests analog pin notifications.
  • Verify the method returns the expected results for various values.
GenerateReportDigitalPortRequest(int port, bool enable) - Requests digital pin notifications.
  • Verify the method returns the expected results for various values.
GenerateSystemResetRequest() - Requests a remote Firmata system reset (not Arduino reset).
  • Verify the method returns the expected result.
GenerateSetPinModeRequest(int pinNumber, PinMode state) - Sets the pin to the desired pin mode.
  • Verify the method returns the expected results for various values.
GenerateProtocolVersionRequest() - Requests the Firmata protocol version being used on the connected Arduino.
  • Verify the method returns the expected result.
GenerateSetSamplingIntervalRequest(int milliseconds) - Changes the remote polling interval.
  • Verify the method returns the expected results for various values.
GenerateAnalogWriteRequest(int pinNumber, int value) - Writes an analog value (PWM on digital pin)
  • Verify the method returns the expected results for various values.
GenerateDigitalWriteRequest(int portNumber, int value) - Writes a digital value to a port (group of pins)
  • Verify the method returns the expected results for various values.
GenerateServoConfigRequest(int pinNumber, int minPulse, int maxPulse, int angle) - Configures Firmata for a connected servo.
  • Verify the method returns the expected results for various values.
GenerateServoPositionRequest(int pinNumber, int value) - Requests a change in the servo position.
  • Verify the method returns the expected results for various values.

Last edited Jun 17, 2010 at 3:07 AM by RhyMednick, version 5

Comments

No comments yet.