Win a copy of Serverless Applications with Node.js this week in the NodeJS 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
  • Liutauras Vilda
  • Bear Bibeault
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Junilu Lacar
  • Paul Clapham
  • Knute Snortum
Saloon Keepers:
  • Stephan van Hulst
  • Ron McLeod
  • Tim Moores
  • salvin francis
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Vijitha Kumara

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: 39208
726
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: 39208
726
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.
 
We're all out of roofs. But we still have tiny ads:
global solutions you can do at home or in your backyard
https://www.kickstarter.com/projects/paulwheaton/better-world-boo
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!