Esempio n. 1
0
        public void CanFollowSimpleLink()
        {
            // Arrange
              ILink link = new AtomLink(new Uri("http://dr.dk"), "http://dr.dk/", "home", "text/html", "Danish Television");

              // Act
              Request request = link.Follow(Session);

              // Assert
              Assert.IsNotNull(request);
              Assert.AreEqual(link.HRef, request.Url.AbsoluteUri);
        }
Esempio n. 2
0
        public void CanFollowLinkWithoutExplicitSession()
        {
            // Arrange
              string url = ResolveTestUrl(Constants.CatsPath).AbsoluteUri;
              ILink link = new AtomLink(url, "self", MediaType.ApplicationJson, "Test");

              // Act
              using (var response = link.Follow().AcceptJson().Get<Cat>())
              {
            var body = response.Body;

            // Assert
            Assert.IsNotNull(body);
            Assert.AreEqual("MIAUW", body.Name);
              }
        }