-
Notifications
You must be signed in to change notification settings - Fork 178
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1026 from hardikSinghBehl/feature/joke
- Loading branch information
Showing
6 changed files
with
83 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
src/main/java/net/datafaker/providers/entertainment/Joke.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package net.datafaker.providers.entertainment; | ||
|
||
import net.datafaker.providers.base.AbstractProvider; | ||
|
||
public class Joke extends AbstractProvider<EntertainmentProviders> { | ||
|
||
protected Joke(final EntertainmentProviders faker) { | ||
super(faker); | ||
} | ||
|
||
public String pun() { | ||
return resolve("joke.puns"); | ||
} | ||
|
||
public String knockKnock() { | ||
return resolve("joke.knock_knocks"); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
en: | ||
faker: | ||
joke: | ||
puns: | ||
- "I'm reading a book on anti-gravity. It's impossible to put down!" | ||
- "I told my friend 10 jokes to make him laugh. Sadly, no pun in ten did." | ||
- "I used to be a baker because I kneaded dough." | ||
- "I told my wife she was drawing her eyebrows too high. She looked surprised." | ||
- "I told my computer I needed a break, and now it won't stop sending me vacation ads." | ||
- "The scarecrow won an award because he was outstanding in his field." | ||
- "The magician got so mad, he pulled his hare out." | ||
- "Apparently you cannot use ‘beefstew’ as password, because It’s not stroganoff" | ||
- "I told my mom she should embrace her mistakes. She gave me a hug." | ||
- "My wife asked me to put ketchup on the shopping list that I was making and now, I can’t read anything." | ||
- "I don't appreciate people who take drugs, like those airport security folks." | ||
- "With great power comes a huge electric bill." | ||
- "My three favorite things are eating my family and not using commas." | ||
- "Justice is a dish best served cold, if it were served warm, it would be justwater." | ||
- "My wife has a weird habit of starting conversations by saying 'Are you even listening to me?'" | ||
- "If you take the 'P' out of a Pirate, he becomes very angry." | ||
- "I was shocked when I found out my toaster wasn’t waterproof." | ||
- "I once had a psychic girlfriend, she left me before we met." | ||
- "I'm always frank on dates. I don't want them knowing my real name." | ||
- "When you tickle a man to death by accident, it is manslaughter." | ||
- "Talking to people about the benefits of dried grapes is all about raisin awareness." | ||
- "Say what you want about waitresses but they bring a lot to the table." | ||
- "Mike Tyson is such a religious guy, he punches people in the faith." | ||
- "Mike Tyson is such a moral philosopher. To stay in shape, he spends a lot of time ethicizing." | ||
- "My email password was hacked again and that's the third time I had to rename the dog." | ||
- "Shout out to the people wondering what the opposite of in is." | ||
knock_knocks: | ||
- "Knock, knock. Who's there? Alpaca. Alpaca who? Alpaca the suitcase, you load up the car!" | ||
- "Knock, knock. Who's there? Atch. Atch who? Bless you!" | ||
- "Knock, knock. Who's there? Boo. Boo who? Aw, don't cry, it's just a joke!" | ||
- "Knock, knock. Who's there? Lettuce. Lettuce who? Lettuce in, it's freezing out here!" | ||
- "Knock, knock. Who's there? Cow says. Cow says who? No silly, cow says moo!" | ||
- "Knock, knock. Who's there? Alzheimer. Alzheimer who? Knock knock" | ||
- "Knock, knock. Who's there? A week. A week who? Yeah, we cool" | ||
- "Knock, knock. Race Condition. Who's there?" | ||
- "Who’s there? Dejav. Dejav who? Knock, knock." |
18 changes: 18 additions & 0 deletions
18
src/test/java/net/datafaker/providers/entertainment/JokeTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package net.datafaker.providers.entertainment; | ||
|
||
import java.util.Collection; | ||
import java.util.List; | ||
|
||
class JokeTest extends EntertainmentFakerTest { | ||
|
||
private final Joke joke = getFaker().joke(); | ||
|
||
@Override | ||
protected Collection<TestSpec> providerListTest() { | ||
return List.of( | ||
TestSpec.of(joke::pun, "joke.puns"), | ||
TestSpec.of(joke::knockKnock, "joke.knock_knocks") | ||
); | ||
} | ||
|
||
} |