I was wondering what options do I have to set up unit tests with the business rules. Currently our business rules get very big with many different responsibilities. This isn't ideal but it is what we have to work with. I was wondering how could I set up unit tests to test the different features of a single business rule? I was thinking of using the business rules server in some way to run tests.
This is an example of what I am looking for
Business Rule Name : Form Load
Description: Sets values, drop downs and accessibility to form
//Current User viewing form
var Cuser = _data.getParameter('subject.id');
//Create Doc Type List
var w = null;
eval ('w=' + http.get('http://localhost:8082/database/TEST/getDocType'));
var opts1= ;
for (var i=0; i < w.resultSet.length; i++)
opts1[i] = w.resultSet[i].ListItem + '=' + w.resultSet[i].ListItem ;
ddlOptions.options = opts1
radCheck.enabled = true;
radCheck.value = 'Yellow';
In the above example I would want to make sure the http requests are going out correctly if there isn't a value in ddlOptions the if statement is enabling radCheck, etc.
Right now my team and I are in a fear driven deadlock. We don't want to make any changes to optimize our business rules yet we still have to make work around changes. The more of these we do the worse the code gets.
Please sign in to leave a comment.