Quantcast
Channel: Planet Object Pascal
Viewing all articles
Browse latest Browse all 1725

The Wiert Corner - irregular stream of stuff: jpluimers

$
0
0

Please someone add the Software on a String blog to DelphiFeeds (:

Great article on testing implementations of interfaces in a generic way. With examples in NUnit and DUnit.

How do I test an interface? Should I even do that? | Software on a String.

And then Stefan Glienke made a great comment at https://plus.google.com/u/0/+MarjanVenema/posts/Dgb8WADLwXZ making the DUnit implementation even easier:

But even if you go without that extra base class the cool thing is that you don’t need to restrict your classes to be a TInterfacedObject but specify the interface they need to implement (yay, compiletime type safety) and then you can get rid of the Supports call and directly assign the result of the ctor call to the sut variable.

–jeroen

Stefan’s code:


Filed under: Delphi, Delphi 2007, Delphi 2010, Delphi XE, Delphi XE2, Delphi XE3, Delphi XE4, Delphi XE5, Delphi XE6, Delphi XE7, Development, Software Development

Viewing all articles
Browse latest Browse all 1725

Trending Articles