I write lots of scripts (VBScript or JScript) on windows platform (under Windows Scripting Host environment). They are mainly used to test the COM object (written in Delphi Seattle). I also have to write a unit tests runner in C# using MSTest or NCrunch or Resharper to run these scripting tests, but they are not lightweight, as I need to add these tests in the Unit Tests project solution space.
Good news is that there is a ‘ScriptUnit’ which is a tiny little tool that is made for this: run tests written in VBScript/JScript.
Drag the VBScript/JScript into the software and click ‘Run All’ button. Tests will run: Green indicates success while red indicates failure (exception or error thrown). You could also use the inbuilt TestObject functions for example:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | function TestOne() { Assert.IsTrue("a" > ""); } function TestTwo() { Assert.IsNothing(null); } function TestThree() { Assert.IsEqual("a", "a", "The a's don't match"); } function TestFour() { Assert.IsEqual("a", "a", "The a's don't match"); } |
function TestOne() { Assert.IsTrue("a" > ""); } function TestTwo() { Assert.IsNothing(null); } function TestThree() { Assert.IsEqual("a", "a", "The a's don't match"); } function TestFour() { Assert.IsEqual("a", "a", "The a's don't match"); }
Alternatively, you could write a few helper functions such as VBScript and JScript.
Download the binaries and source code here (freeware, no installation required).
–EOF (The Ultimate Computing & Technology Blog) —
loading...
Last Post: Number of Solutions for Math Equations: 3x + y = 5702
Next Post: Interview Question: Construct Evenly-Distribution Rand7 based on Rand5