I've just discovered that the MVC approach I've adopted (http://shuffl-announce.blogspot.com/2009/09/framework-for-testing-shuffl-card.html) makes it really easy to create mock shuffl cards (in the sense of mock objects: http://en.wikipedia.org/wiki/Mock_object) for testing.
Here's one I used today to test the drag-and-drop drop-target logic in a data visualization card:
// Instantiate mock table cardvar tc = jQuery("<div/>");tc.model('shuffl:labels',carddatagraph_labels1);tc.model('shuffl:series',carddatagraph_series1);
The jQuery.model plugin I mentioned previously provides all the additional logic needed to ensure the mock card object responds as required to requests for information.
No comments:
Post a Comment