• 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
  • Junilu Lacar
  • Martin Vashko
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Scott Selikoff
  • salvin francis
  • Piet Souris

Testing

 
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: 39664
785
Eclipse IDE VI Editor Java
  • 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: 39664
785
Eclipse IDE VI Editor Java
  • 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.
 
Been there. Done that. Went back for more. But this time, I took this tiny ad with me:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!