starlocke / markdownsharp

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

The Markdown class should implement an interace to make mocking easier #33

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

Public methods are not virtual so some mocking frameworks are unable to easily 
mock the Markdown class for unit testing.

What is the expected output? What do you see instead?

N/A

What version of the product are you using? On what operating system?

1.12, Windows

Please provide any additional information below.

Using Visual Studio refactoring tools, simply use Create Interface.  This will 
create an IMarkdown (by default) interface and set the class to implement it.  
Users can then mock this interface for unit tests, supplying an instance of the 
class for production code.

Original issue reported on code.google.com by tvanfos...@gmail.com on 10 Jun 2010 at 6:19

GoogleCodeExporter commented 9 years ago
I don't understand the advantage here versus the existing unit tests that are 
shipped in the code?

Original comment by wump...@gmail.com on 3 Jul 2010 at 8:15

GoogleCodeExporter commented 9 years ago
The point is that I would like to mock out the Markdown class in my code.  Most 
mocking frameworks require that you mock an interface or that the class have 
virtual methods.  Adding an interface, which the Markdown class implements, 
makes it trivial to mock it in my code.

Original comment by tvanfos...@gmail.com on 6 Jul 2010 at 1:31

GoogleCodeExporter commented 9 years ago

Original comment by wump...@gmail.com on 12 Nov 2010 at 9:03

GoogleCodeExporter commented 9 years ago

Original comment by wump...@gmail.com on 12 Nov 2010 at 9:04