Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
GoogleCodeExporter opened this issue Mar 14, 2016 · 4 comments

Comments

@GoogleCodeExporter
Copy link

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
Copy link
Author

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
Copy link
Author

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
Copy link
Author

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

  • Added labels: Priority-Low
  • Removed labels: Priority-Medium

@GoogleCodeExporter
Copy link
Author

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

  • Added labels: Type-Enhancement
  • Removed labels: Type-Defect

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant