I am trying to write a test using the Truffle framework and for one of the tests I need to send the contract some ether. Is there a way that I can programmatically make a specified ether account send money to the contract?
You should be able to do this using the
web3.eth.accounts array (ex:
web3.eth.accounts). If you are using test-rpc, there will be a set of pre-created accounts that are accessible via that array.
There is a tutorial you could try following: https://citywebconsultants.co.uk/blog/blockchain/introducing-ethereum-development-part-3-testrpc-and-truffle