ripple/rippled — pull request #728 by scottschurr (2014-11-19 00:00:45+00:00)
Title: Add more unit tests to rpc/impl/TransactionSign [RIPD-480]

By adding a mock it is possible to test the transactionSign
function without interacting with the ledger. This is the
smallest change I could come up with that allows transactionSign
to be unit tested.

The unit tests are white boxed. Each test case is a result
of examining the code and identifying behavior associated with
different JSON fields. That means the tests are not based on
requirements, they are based on observed behavior.

The point of adding unit tests is to increase confidence in the
face of expected future refactors of this code. If the refactors
continue to pass these unit tests then they are less likely to
have changed important behavior.

@vinniefalco because he has strong opinions on unit tests.
@nbougalis because he's been in this part of the code.
@JoelKatz (optional) I know David is buried in code reviews,
but it would be great if he has time to look at this.