dox Executable Documentation

Flat model

Undefined property

Given the model '{}'
When I render 'Hello <span property="undefined">World</span>'
Then the result should be 'Hello <span property="undefined">World</span>'

False and null values

Given the model '{"no":false, "notThere":null}'
When I render 'Hello<span property="no"> All</span><span property="notThere"> World</span>'
Then the result should be 'Hello'

True value

Given the model '{"yes":true}'
When I render '<span property="yes">Hello World</span>'
Then the result should be '<span property="yes">Hello World</span>'

Content value

Given the model '{"greetings":"Hello", "name":"World"}'
When I render ' <span property="greetings">Hey</span> <span property="name">You</span>'
Then the result should be ' <span property="greetings">Hello</span> <span property="name">World</span>'

Zero leaf value

Given the model '{"zero":0}'
When I render 'This is <span property="zero">zero</span>'
Then the result should be 'This is <span property="zero">0</span>'

Nested element structure

Given the model '{"message":"Hello World"}'
When I render '<div><h1><a property="message">My Message</a></h1></div>'
Then the result should be '<div><h1><a property="message">Hello World</a></h1></div>'

Html content

Given the model '{"html":"<b>Hello</b>"}'
When I render '<div property="html"><span>Before</span></div>'
Then the result should be '<div property="html"><b>Hello</b></div>'