daniellmb / markdownsharp

Automatically exported from code.google.com/p/markdownsharp
1 stars 0 forks source link

Unit test refactoring #13

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I'm proposing the following changes:

1. Follow the Four-Phase Test pattern 
(http://xunitpatterns.com/Four%20Phase%20Test.html)  (we don't have any 
teardown, so we're left with three phases, but it's still worth doing)

2. Remove duplication of var m = new Markdown() in every test.

3. Introduce variables for input, expected and actual.  This separates the 
data from the logic of the test, which should make it easier to read.  For 
most tests in this patch, you only have to read the first two lines to see 
what they're doing.

See attached patch.  I look forward to hearing any comments.

Original issue reported on code.google.com by kevin.ba...@gmail.com on 4 Jan 2010 at 2:34

Attachments:

GoogleCodeExporter commented 9 years ago
I agree with these changes. They improve readability and makes debugging easier.

Original comment by asbjornu on 4 Jan 2010 at 8:34

GoogleCodeExporter commented 9 years ago
included in r68

Original comment by wump...@gmail.com on 5 Jan 2010 at 1:03