Exemplo n.º 1
0
 public void RetrievingAnOpenIssue()
 {
     _fakeIssue = FakeIssues.Single(i => i.Status == IssueStatus.Open);
     this.Given(x => x.GivenAnExistingIssue("1"), false)
     .When(x => x.WhenItIsRetrieved(_uriIssue1), false)
     .Then(x => x.ThenItShouldHaveACloseActionLink())
     .BDDfy();
 }
Exemplo n.º 2
0
        public void RetrievingAClosedIssue()
        {
            _fakeIssue = FakeIssues.Single(i => i.Status == IssueStatus.Closed);

            this.Given(x => x.GivenAnExistingIssue("2"), "Given an existing closed issue")
            .When(x => x.WhenItIsRetrieved(_uriIssue2), false)
            .Then(x => x.ThenItShouldHaveAnOpenActionLink())
            .BDDfy();
        }
Exemplo n.º 3
0
 public void RetrievingAClosedIssue(Issue fakeIssue, IssueState issue)
 {
     "Given an existing closed issue".
     f(() =>
     {
         fakeIssue = FakeIssues.Single(i => i.Status == IssueStatus.Closed);
         MockIssueStore.Setup(i => i.FindAsync("2")).Returns(Task.FromResult(fakeIssue));
     });
     "When it is retrieved".
     f(() =>
     {
         Request.RequestUri = _uriIssue2;
         issue = Client.SendAsync(Request).Result.Content.ReadAsAsync <IssueState>().Result;
     });
     "Then it should have a 'open' action link".
     f(() =>
     {
         var link = issue.Links.FirstOrDefault(l => l.Rel == IssueLinkFactory.Rels.IssueProcessor && l.Action == IssueLinkFactory.Actions.Open);
         link.ShouldNotBeNull();
         link.Href.AbsoluteUri.ShouldEqual("http://localhost/issueprocessor/2?action=open");
     });
 }