• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Junit Task Help for checking null in a test case

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Anybody tries to set test cases for this task below:

When the argument passed to the method is null it returns an empty string • When the string has exactly one character the same string is returned When the string is longer then 1 character its nice version is returned. Examples of invert method usage nice.change("x"); // returns "x" // returns in nice.change(null); nice.change("KY"); // return "YK" Requirements • Your task is to implement a suite of tests in JUnit 4 that will test all the possible behaviours of the invert method, as described above. Your suite of tests will be run against multiple (wrong and correct) implementations of invert method.

Your quick feedback would be highly appreciated.
 
Sheriff
Posts: 17652
300
Mac Android IntelliJ IDE Eclipse IDE Spring Debian Java Ubuntu Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to the Ranch!

Please show us what you have tried so far and tell us where you're having difficulty. The people here can help by giving you tips and advice on how to make your tests better but you won't find anyone who will do your work for you.
 
If tomatoes are a fruit, then ketchup must be a jam. Taste this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic