// Test average guess value is working correctly. The two guesses // should be summed, divided by 2, then rounded down to the nearest // whole number public static string testAverageGuessValue() { encryption.encryptWord averageGuess = new encryptWord(); averageGuess.GuessShiftValue(2); averageGuess.GuessShiftValue(5); return(averageGuess.DisplayGuessStatistics()); }
// Test resetting the EncryptWord object. Input a low guess, high guess // and a correct guess. Then call ResetObject function. // DisplayGuessStatistics function then should have all statistics set // to 0's. public static string testResetObject() { encryption.encryptWord resetTest = new encryptWord(); resetTest.GuessShiftValue(0); resetTest.GuessShiftValue(3); resetTest.GuessShiftValue(5); resetTest.ResetObject(); return(resetTest.DisplayGuessStatistics()); }
// Test a high guess value. numberOfHighGuesses should increment and // average guess value should update to guess value public static string testHighGuessValue() { encryption.encryptWord highGuess = new encryptWord(); highGuess.GuessShiftValue(4); return(highGuess.DisplayGuessStatistics()); }
// Test a correct SHIFT value. numberOfQueries should increment and // average guess value should update to guess value public static string testCorrectGuessValue() { encryption.encryptWord correctGuess = new encryptWord(); correctGuess.GuessShiftValue(3); return(correctGuess.DisplayGuessStatistics()); }
// Test a low guess value. numberOfLowGuesses should increment and // average guess value should update to guess value public static string testLowGuessValue() { encryption.encryptWord lowGuess = new encryptWord(); lowGuess.GuessShiftValue(0); return(lowGuess.DisplayGuessStatistics()); }