• Post Reply Bookmark Topic Watch Topic
  • New Topic

Make sense test this abstract class?  RSS feed

 
Isaac Ferguson
Ranch Hand
Posts: 1063
3
Java Netbeans IDE Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

make sense to test this abstract class?



Regards, Isaac
 
Stephan van Hulst
Saloon Keeper
Posts: 7993
143
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No. There's no point in testing abstract methods.

Actually, it doesn't make sense for it to be an abstract class in the first place. Why isn't it an interface?

Why are Paper, Scissors and Rock different classes?
 
Campbell Ritchie
Marshal
Posts: 56599
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How do you intend to test it?
Didn't we show you a better way to implement the game in your earlier thread? Why are you returning ints?
 
Isaac Ferguson
Ranch Hand
Posts: 1063
3
Java Netbeans IDE Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It is the logic to make this:




For paper it would be like this:
 
Campbell Ritchie
Marshal
Posts: 56599
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You have already been told that is a bad way to implement the game. Why are you using ints?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!