Created
February 16, 2011 04:16
-
-
Save nicocrm/828858 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
<html xmlns="http://www.w3.org/1999/xhtml"> | |
<head> | |
<title></title> | |
<link rel="stylesheet" href="http://code.jquery.com/qunit/git/qunit.css" type="text/css" | |
media="screen" /> | |
</head> | |
<body> | |
<h1 id="qunit-header"> | |
QUnit example</h1> | |
<h2 id="qunit-banner"> | |
</h2> | |
<div id="qunit-testrunner-toolbar"> | |
</div> | |
<h2 id="qunit-userAgent"> | |
</h2> | |
<ol id="qunit-tests"> | |
</ol> | |
<div id="qunit-fixture"> | |
test markup, will be hidden</div> | |
<div style="clear: both"> | |
<button runat="server" id="btnSmallEmail"> | |
Send Small Email | |
</button> | |
<button runat="server" id="btnLargeEmail"> | |
Send Large Email | |
</button> | |
</div> | |
<script type="text/javascript" src="require.js"></script> | |
<script type="text/javascript" src="http://code.jquery.com/qunit/git/qunit.js"></script> | |
<script type="text/javascript" src="http://code.jquery.com/jquery-1.2.3.js"></script> | |
<script type="text/javascript"> | |
require(["./WriteEmail"], function (email) { | |
require.ready(function () { | |
test("testAddUrlComponents", function () { | |
equals(email.addUrlComponents("", "123", 3), "123"); | |
equals(email.addUrlComponents("", "1", 3), "1"); | |
equals(email.addUrlComponents("", ["1", "123"], 3), "112"); | |
equals(email.addUrlComponents("", ["1", " "], 3), "1"); | |
equals(email.addUrlComponents("2", ["1", " "], 3), "21"); | |
equals(email.addUrlComponents("1", ["2", "3"], 3, ","), "12"); | |
equals(email.addUrlComponents("1", ["2", ",3"], 40), "12%2C3"); | |
equals(email.addUrlComponents("1", ["2", ",3"], 40, "", false), "12,3"); | |
equals(email.addUrlComponents("1", ["2", "345"], 4, ","), "12,3"); | |
equals(email.addUrlComponents("1", ["2", "345"], 4, ",", false, false), "12"); | |
}); | |
$("#btnSmallEmail").click(function () { | |
email.writeMail("test@nowhere.com", "subject", "body"); | |
}); | |
$("#btnLargeEmail").click(function () { | |
var emails = []; | |
for (var i = 0; i < 1000; i++) { | |
emails.push("test" + i + "@nowhere.com"); | |
} | |
var lorem = ""; | |
for (var i = 0; i < 100; i++) | |
lorem += "\n" + "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."; | |
email.writeMail(emails, "subject", lorem); | |
}); | |
}); | |
}); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment