File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

A question about Blue J and testing

 
Edward Blom
Greenhorn
Posts: 4
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm writing on a program in Blue J that got a class called dice that creates random numbers. How do I create a testing class that searches if the result of a function is between two numbers like 1-50?
I can only find a function that checks the result for a fixed value.
 
Peter Johnson
author
Bartender
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Edward, welcome to Java Ranch!

Try storing the result of the function in a variable and then using an expression to determine if the value is in range. Something like this:



I could be more specific if you were using JUnit, but I don't know what facilities BlueJ provides for testing.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic