1
vote
Vote UpVote

DUnitX: now has a WillRaiseAttribute to ease defining tests around code that should throw exceptions

The Wiert Corner – I stumbled over this commit message in [WayBack] “extended the TestAttribute with “Expected” property (#181)” which isn’t phrased correctly, but adds a very nice feature. The feature is about WillRaiseAttribute: constructor WillRaiseAttribute.Create(AExpectedException: ExceptClass; const AInheritance: TExceptionInheritance); This allows tests like these: [WillRaise(EOutOfMemory)] procedure FailMe; [WillRaise(EHeapException, exDescendant)] procedure FailMeToo; [WillRaise(Exception, exDescendant)] procedure FailAny; ...
Favorite? Off-Topic? jpluimers @ 2018-08-29 13:04

Statistics

Visits: 86
Votes: 1
Favorites: 0
Off-Topic: 0

Visits by Source

User Actions

Users who voted for this posting

Alister Christie
Subscribe:
Contact us to advertise on DelphiFeeds.com

Community Links

Torry Firebird News

Sponsor

 
Please login or register to use this functionality.
(click on this box to dismiss)