On Tue, Jun 5, 2012 at 11:55 AM, Camillo Bruni <[email protected]> wrote: >> testGeneralInquiries >> | now d t dt | >> >> now := self timeClass dateAndTimeNow. >> self >> assert: now size = 2; >> assert: now last <= self timeClass now. >> >> self should: [ self timeClass timeWords ] raise: MessageNotUnderstood. >> >> d := '2 June 1973' asDate. >> t := '4:02:47 am' asTime. >> dt := self timeClass dateAndTimeFromSeconds: (2285280000 + 14567). >> self >> assert: dt = {d. t.}. >> >> >> The middle part is a GREAT example of a useful unit test… > > that's called a negative test :D, assume what possible could fail in the > universe and test for it :D
I will write a paper on automatic negative test generation. Who wants to join? :-) -- Damien Cassou http://damiencassou.seasidehosting.st "Lambdas are relegated to relative obscurity until Java makes them popular by not having them." James Iry
