Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Testing Abstract Class Concrete Methods

How would I design and organize tests for the concrete methods of an abstract class? Specifically in .NET.

like image 906
Russell Myers Avatar asked Sep 19 '08 19:09

Russell Myers


1 Answers

You have to create a subclass that implements the abstract methods (with empty methods), but none of the concrete ones. This subclass should be for testing only (it should never go into your production code). Just ignore the overridden abstract methods in your unit tests and concentrate on the concrete methods.

like image 56
Bill the Lizard Avatar answered Sep 20 '22 17:09

Bill the Lizard