???????
????QUnit?????????JavaScript??????????????????jQuery??jQuery UI??jQuery Mobile?????????κ????JavaScript?????д???????????
???????л???
?????κ?Html??JavaScript??????Visual Studio 2013??
??????QUnit???????reference js??css???
????????QUnit?????????
???????QUnit.js??QUnit.css??????????HTML????С?
????<script src="//code.jquery.com/qunit/qunit-1.22.0.js"></script>
????<link rel="stylesheet"
????href="https://code.jquery.com/qunit/qunit-1.22.0.css">
??????????????е???????JavaScript??
??????????е?????????????????????js????У?Calculations.js????
????// Create Calculation class.
????var Calculation = function () { };
????// Add Addition to method to the Calculation class.
????Calculation.prototype.Add = function (a?? b) {
????return a + b;
????};
????// Add Subtraction method to the Calculation class.
????Calculation.prototype.Substraction = function (a?? b) {
????return a - b;
????};
????// Add Multiplication method to the Calculation class.
????Calculation.prototype.Multiplication = function (a?? b) {
????return a * b;
????};
????// Add Division method to the Calculation class.
????Calculation.prototype.Division = function (a?? b) {
????return a / b;
????};
???????????????????????????????
??????????????????JavaScript?????????????????????????????????????????js????У?UnitTest.js????
????// Instantiate Calculation class.
????var c = new Calculation();
????// Unit test for addition.
????QUnit.test("Addition Test"?? function (assert) {  
????assert.ok(c.Add(2?? 3) == "5"?? "Passed!");
????});
????// Unit test for subtraction.
????QUnit.test("Substraction Test"?? function (assert) {
????assert.ok(c.Substraction(3?? 2) == "1"?? "Passed!");
????});
????// Unit test for division.
????QUnit.test("Division Test"?? function (assert) {
????assert.ok(c.Division(5?? 5) == "1"?? "Passed!");
????});
????// Unit test for multiplication.
????QUnit.test("Multiplication Test"?? function (assert) {
????assert.ok(c.Multiplication(5?? 5) == "25"?? "Passed!");
????});
??????HTML?????????????е?js??css???
??????HTML?????з???????id?qunit??qunit-fixture??div????
????<link rel="stylesheet" href="https://code.jquery.com/qunit/qunit-1.22.0.css">
????<script src="~/Scripts/Calculations.js"></script>
????<div id="qunit"></div>
????<div id="qunit-fixture"></div>
????<script src="//code.jquery.com/qunit/qunit-1.22.0.js"></script>
????<script src="~/Scripts/UnitTest.js"></script>
????QUnit??????????