FwdRatesActionMock

Here is where you write the code you really expect to want to write.

The FwdRatesDB is the class that serves up the collection of FwdRate objects you want returned in the ArrayCollection. Make it what you want it!

package
{
	import IFwdRatesAction;
	import FwdRatesDB;
	import FwdRatesEvent;

	import mx.collections.ArrayCollection;
	import mx.logging.ILogger;
	import mx.logging.Log;
	import mx.rpc.AsyncToken;

	public class FwdRatesActionMock extends GenericActionMock implements IFwdRatesAction
	{
		private static var log:ILogger = Log.getLogger("FwdRatesActionMock");

		[Inject]
		public var fwdRatesDB:FwdRatesDB;

		public function FwdRatesActionMock(wantGoodResult:Boolean = true)
		{
			super(wantGoodResult);
		}

		[Command]
		public function getFXFwdRates(event:FwdRatesEvent) : AsyncToken
		{
			log.debug("called getFXFwdRates");
			var fwdRates:ArrayCollection = fwdRatesDB.getFwdRates();
			var token:AsyncToken = new AsyncToken();
			token.data = fwdRates;
			sendAsyncToken(token);
			return token;
		}

	}
}