-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added the MichaelScott faker. (#117)
* Added the documentation. * Added the data. * Implemented the MichaelScott faker. * Added the MichaelScott faker to the main faker classes.
- Loading branch information
Showing
9 changed files
with
128 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Faker.MichaelScott | ||
|
||
```cs | ||
Faker.MichaelScott.Quote() //=> "I am Beyoncé, always." | ||
``` |
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,51 @@ | ||
using System.Collections.Generic; | ||
|
||
namespace FakerDotNet.Data | ||
{ | ||
internal static class MichaelScottData | ||
{ | ||
public static readonly IEnumerable<string> Quotes = new[] | ||
{ | ||
"Would I rather be feared or loved? Easy. Both. I want people to be afraid of how much they love me.", | ||
"Dwight, you ignorant slut!", | ||
"If I had a gun with two bullets and I was in a room with Hitler, Bin Laden, and Toby, I would shoot Toby twice.", | ||
"You wanna hear a lie? ... I...think you're great. You're my best friend.", | ||
"Webster's Dictionary defines wedding as: The fusing of two metals with a hot torch.", | ||
"Sometimes I'll start a sentence and I don't even know where it's going. I just hope I find it along the way.", | ||
"There were these huge bins of clothes and everybody was rifling through them like crazy. And I grabbed one and it fit! So I don't think that this is totally just a woman's suit. At the very least it's bisexual.", | ||
"The worst thing about prison was the Dementors. They were flying all over the place and they were scary and they'd come down and they'd suck the soul out of your body and it hurt!", | ||
"I feel like all my kids grew up, and then they married each other. It's every parents' dream.", | ||
"You don't know me, you've just seen my penis.", | ||
"St. Patrick's Day is the closest thing the Irish have to Christmas.", | ||
"I am Beyoncé, always.", | ||
"And I knew exactly what to do. But in a much more real sense, I had no idea what to do.", | ||
"When the son of the deposed king of Nigeria emails you directly, asking for help, you help! His father ran the freaking country! Ok?", | ||
"I have cause. It is beCAUSE I hate him.", | ||
"I am running away from my responsibilities. And it feels good.", | ||
"Society teaches us that having feelings and crying is bad and wrong. Well, that's baloney, because grief isn't wrong. There's such a thing as good grief. Just ask Charlie Brown.", | ||
"Saw Inception. Or at least I dreamt I did.", | ||
"I'm an early bird and I'm a night owl. So I'm wise and I have worms.", | ||
"Number 8. Learn how to take off a woman's bra: You just twist your hand until something breaks.", | ||
"I love my employees even though I hit one of you with my car.", | ||
"You know what they say. 'Fool me once, strike one, but fool me twice...strike three.", | ||
"I am downloading some NP# music.", | ||
"I am dead inside.", | ||
"WHERE ARE THE TURTLES?!", | ||
"Welcome back, Jerky Jerk-Face.", | ||
"Should have burned this place down when I had the chance.", | ||
"Well, just tell him to call me as asap as possible.", | ||
"Well, happy birthday, Jesus. Sorry your party's so lame.", | ||
"Do you think that doing alcohol is cool?", | ||
"I love inside jokes. Love to be a part of one someday.", | ||
"That's what she said.", | ||
"No, I'm not going to tell them about the downsizing. If a patient has cancer, you don't tell them.", | ||
"There is no such thing as an appropriate joke, that's why it's a joke.", | ||
"You may look around and see two groups here: white collar, blue collar. But I don't see it that way, and you know why not? Because I am collar-blind.", | ||
"I would not miss it for the world. But if something else came up I would definitely not go.", | ||
"I don't come up with this stuff, I just forward it along. You wouldn't arrest the guy who was just passing drugs from one guy to another.", | ||
"Make friends first, make sales second, make love third. In no particular order.", | ||
"It's a pimple, Phyllis. Avril Lavigne gets them all the time and she rocks harder than anyone alive.", | ||
"Wikipedia is the best thing ever. Anyone in the world can write anything they want about any subject. So you know you are getting the best possible information." | ||
}; | ||
} | ||
} |
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
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,24 @@ | ||
using FakerDotNet.Data; | ||
|
||
namespace FakerDotNet.Fakers | ||
{ | ||
public interface IMichaelScottFaker | ||
{ | ||
string Quote(); | ||
} | ||
|
||
internal class MichaelScottFaker : IMichaelScottFaker | ||
{ | ||
private readonly IFakerContainer _fakerContainer; | ||
|
||
public MichaelScottFaker(IFakerContainer fakerContainer) | ||
{ | ||
_fakerContainer = fakerContainer; | ||
} | ||
|
||
public string Quote() | ||
{ | ||
return _fakerContainer.Random.Element(MichaelScottData.Quotes); | ||
} | ||
} | ||
} |
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
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,31 @@ | ||
using FakeItEasy; | ||
using FakerDotNet.Data; | ||
using FakerDotNet.Fakers; | ||
using NUnit.Framework; | ||
|
||
namespace FakerDotNet.Tests.Fakers | ||
{ | ||
[TestFixture] | ||
[Parallelizable] | ||
public class MichaelScottFakerTests | ||
{ | ||
[SetUp] | ||
public void SetUp() | ||
{ | ||
_fakerContainer = A.Fake<IFakerContainer>(); | ||
_michaelScottFaker = new MichaelScottFaker(_fakerContainer); | ||
} | ||
|
||
private IFakerContainer _fakerContainer; | ||
private IMichaelScottFaker _michaelScottFaker; | ||
|
||
[Test] | ||
public void Quote_returns_a_quote() | ||
{ | ||
A.CallTo(() => _fakerContainer.Random.Element(MichaelScottData.Quotes)) | ||
.Returns("I am Beyoncé, always."); | ||
|
||
Assert.AreEqual("I am Beyoncé, always.", _michaelScottFaker.Quote()); | ||
} | ||
} | ||
} |