Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Button handy
blanktrue
color#0052CC
nameSend Feedback
linkhttps://docs.google.com/forms/d/e/1FAIpQLScmToBe3vynAlb5fdKwCGxYqnTbDc66sIBgeecG2BuFDuHc7g/viewform?entry.2002826954=Introduction+to+Test-Driven+Design+%28TDD%29+-+491001579
widthauto

What is the most effective approach to developing scripts and code maintenance? Well, with Test-Driven Design, of course!

...

If you have not already done so, please read this introduction to silUnit. For our first test case, create a routine function sayHello() which simply returns the string "hello". 

...

Step 1 - Create a Basic Test

Our routine function below is fairly simple. We create a function, itSaysHello(), and place the "/** TEST **/" annotation above so that the silUnit recognizes it as a test. 

Code Block
include "Includes/_silUnit.incl";
include "hello.sil";
 
 
/** TEST **/
function itSaysHello() {
    assertEquals(sayHello(), "hello");
}

Step 2 - Create a

...

Function Which Causes the Test to Fail

Returning "not hello" would definitely not be saying hello!

...

Page Properties
hiddentrue

Related issues

We've encountered an issue exporting this macro. Please try exporting this page again later.