想为beow函数编写Junit

时间:2015-08-07 18:47:16

标签: jquery unit-testing

验证来自HTMl表单的输入字段。想要编写单元测试用例。需要帮助在Jasmine中实现jasmine单元测试用例

var object = {};
var myclass=function requiredFieldValidator(jQuery) {
    object.utility = {
        requiredFieldValidation : function validation() {
            jQuery("#InsertQuestionAndAnswer").validate({
                rules : {
                    Question : "required",
                    Answer : "required",
                },
                messages : {
                    Question : "Question Cannot be Blank",
                    Answer : "Answer Cannot be Blank",
                },
                submitHandler : function(form) {
                    form.submit();
                }
            });
        }
    } 
    jQuery(document).ready(function() {
        object.utility.requiredFieldValidation();
    });
}(jQuery);

0 个答案:

没有答案