Win a copy of Spring in Action (5th edition) this week in the Spring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Ganesh Patekar
  • Frits Walraven
  • Tim Moores
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Stephan van Hulst
  • salvin francis
  • Tim Holloway

Testing  RSS feed

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can someone help me with Junit Testing, Idon't know how to doallofthem and I'm not even sure I'm doing what I've done correct.
Thank you.
Methods:

Junit test:
 
author & internet detective
Posts: 38911
686
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There's not one right way to right tests. That's a lot of code, but it looks fine at first glance. Was there something specific you were wondering about?
 
Ale Nad
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Jeanne Boyarsky wrote:There's not one right way to right tests. That's a lot of code, but it looks fine at first glance. Was there something specific you were wondering about?


Ok, thank you, I'm not really sure about how to do the last one, the replace method. could you help me ?
 
Jeanne Boyarsky
author & internet detective
Posts: 38911
686
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Think about the different scenarios for replace:
1) The element is found. Here you would check that the method returns true and the map has the new value.
2) The element is not found. Here you would check that the method returns false and the map has the original values.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!