Skip to content

Conversation

@motabhai-bhagwaan
Copy link

Added new tests and changed the way AnimalFactory took input (String instead of direct enum)

Copy link
Owner

@fengyuanyang fengyuanyang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hi , can you have a look on it

Comment on lines +77 to +82
try {
animal = AnimalFactory.getAnimal("BAT");
}
catch (Exception e) {
assertEquals(e.getClass(), IllegalArgumentException.class);
}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this block can be replaced with

assertThrows(IllegalArgumentException.class, () -> AnimalFactory.getAnimal("BAT"));

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants