Skip to content

GitLab

  • Menu
    • Projects Groups Snippets
      Help
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in
  • P project02
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • cs2-19wi
  • project02
  • Merge requests
  • !3

An error occurred while fetching the assigned milestone of the selected merge_request.
Merged
Created 6 years ago by Johanna S. Karras@jkarrasDeveloper

Fixed tests for makeGuess()

  • Overview 0
  • Commits 1
  • Changes 1
  • Adam Blank @blank merged 6 years ago

    merged

  • Adam Blank @blank mentioned in commit b35e36b1 6 years ago

    mentioned in commit b35e36b1

  • Adam Blank @blank mentioned in commit b390aa7d 6 years ago

    mentioned in commit b390aa7d

  • You're only seeing other activity in the feed. To add a comment, switch to one of the following options.
Please register or sign in to reply
Compare
  • master (base)

and
  • latest version
    1adca81c
    1 commit, 6 years ago

1 file
+ 2
- 2

    Preferences

    File browser
    Compare changes
tests/edu/caltech/cs2/project02/GuesserTests.java
+ 2
- 2
  • View file @ 1adca81c

  • Edit in single-file editor

  • Edit in Web IDE


Show all unchanged lines Show 20 lines
@Test
public void testMakeGuessExceptionsInRandom() {
Constructor c = Reflection.getConstructor(RandomHangmanChooser.class, int.class, int.class);
RandomHangmanChooser chooser = Reflection.newInstance(c, 1, 1);
RandomHangmanChooser chooser = Reflection.newInstance(c, 3, 1);
Method m = Reflection.getMethod(RandomHangmanChooser.class, "makeGuess", char.class);
IntStream.range(0, 20).forEach(i -> assertThrows(IllegalArgumentException.class, () -> m.invoke(chooser, (char) ('a' - (i + 1)))));
IntStream.range(0, 20).forEach(i -> assertThrows(IllegalArgumentException.class, () -> m.invoke(chooser, (char) ('z' + (i + 1)))));
Show 20 lines Show all unchanged lines Show 20 lines
@Test
public void testMakeGuessExceptionsInEvil() {
Constructor c = Reflection.getConstructor(EvilHangmanChooser.class, int.class, int.class);
EvilHangmanChooser chooser = Reflection.newInstance(c, 1, 1);
EvilHangmanChooser chooser = Reflection.newInstance(c, 3, 1);
Method m = Reflection.getMethod(EvilHangmanChooser.class, "makeGuess", char.class);
IntStream.range(0, 20).forEach(i -> assertThrows(IllegalArgumentException.class, () -> m.invoke(chooser, (char) ('a' - (i + 1)))));
IntStream.range(0, 20).forEach(i -> assertThrows(IllegalArgumentException.class, () -> m.invoke(chooser, (char) ('z' + (i + 1)))));
Show 20 lines Show all unchanged lines
0 Assignees
None
Assign to
0 Reviewers
None
Request review from
Milestone
No milestone
None
None
Time tracking
No estimate or time spent
Labels
0
None
0
None
    Assign labels
  • Manage project labels

Lock merge request
Unlocked
0
0 participants
Reference:
Source branch: jkarras

Menu

Projects Groups Snippets
Help