-
-
Save darrelmiller/5664092 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
[Scenario] | |
public void RetrievingIssues(IEnumerable<Issue> issues, Mock<IIssueStore> issueStore ) | |
{ | |
var mockIssueStore = new Mock<IIssueStore>(); | |
var fakeIssues = GetFakeIssues(); | |
var controller = new IssueController(mockIssueStore.Object); | |
"Given existing issues". | |
f(() => mockIssueStore.Setup(i => i.FindAsync()).Returns(Task.FromResult(fakeIssues))); | |
"When a GET request is made for all issues". | |
f(() => issues = controller.Get().Result); | |
"Then all issues are returned". | |
f(() => issues.ShouldEqual(fakeIssues)); | |
} | |
private IEnumerable<Issue> GetFakeIssues() | |
{ | |
var fakeIssues = new List<Issue>(); | |
var issue = new Issue(); | |
fakeIssues.Add(issue); | |
return fakeIssues; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment