This file contains hidden or 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
| Make the test more readable using functional assertions. | |
| Before: | |
| ``` | |
| @Test | |
| void testStockNegativeRejection() { | |
| try { | |
| inventory.checkStock(-5); | |
| fail("Should have thrown exception"); |
This file contains hidden or 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
| /** | |
| * Check current URL for parameters: "¶meter=", everything after "=" will be used as VALUE. | |
| * | |
| * @param name URL Parameter Name. For Example userId (in URL ist: &userId=VALUE) | |
| * @returns {*} Parameter VALUE | |
| */ | |
| function getParameter(name) { | |
| url = window.location.href; | |
| name = name.replace(/[\[\]]/g, '\\$&') | |
| var regex = new RegExp('[?&]' + name + '(=([^&#]*)|&|#|$)'), |