Sponsored Link •
|
Summary
I'm test-infected and that's why one of my first exciting Scala discoveries was ScalaTest
Advertisement
|
Actually, the first big thing I noticed about Scala was the crispness I could write my code. Put it together with the ScalaTest framework and you get the following highly-readable and obvious test snippet (excerpted from ScalaTest Testing with Mock Objects: Using Borachio):
Clean.val mockCollaborator = mock[Collaborator] mockCollaborator expects 'documentAdded withArgs ("Document") mockCollaborator expects 'documentChanged withArgs ("Document") repeated 3 times classUnderTest.addDocument("Document", new Array[Byte](0)) classUnderTest.addDocument("Document", new Array[Byte](0)) classUnderTest.addDocument("Document", new Array[Byte](0)) classUnderTest.addDocument("Document", new Array[Byte](0))
Have an opinion? Readers have already posted 4 comments about this weblog entry. Why not add yours?
If you'd like to be notified whenever Dale Asberry adds a new entry to his weblog, subscribe to his RSS feed.
R. Dale Asberry been hacking since 1978, professionally since 1990. He's certified in Java 1.1 and has a four digit MCP number. He discovered Jini at the 2000 JavaOne and has been building incredibly cool, dynamic, distributed architectures ever since! Over time, he's discovered several principles that have contributed to his success - they are the Princples of: Enabling Others, Simplicity, No Complaining, Least Work, Least Surprise, Least Damage, and "It Just Works". |
Sponsored Links
|