public void When_the_file_metadata_is_POSTed() { var newDocumentDetails = new Document("a new example document", "a description of the new example document"); var apiCall = new XmlApiCall(); apiCall.SetRequestAuthenticationMechanism(new OAuth2AuthenticationMechanism(Configuration.OAuth2Token)); _response = apiCall.Post(Configuration.ExampleCreateDocUri, newDocumentDetails); }
public void When_the_file_metadata_is_PUTed() { var newDocumentDetails = new Document("a new example document", "a description of the new example document"); var apiCall = new XmlApiCall(); apiCall.SetRequestAuthenticationMechanism(new OAuth2AuthenticationMechanism(Configuration.OAuth2Token)); _response = apiCall.Post(Configuration.ExampleCreateDocUri, newDocumentDetails); var doc = XmlConverter.FromXml<Document>(_response.Response); var editUrl = doc.GetLinkFor("edit").Href; var parentUrl = doc.GetLinkFor("parent").Href; var putData = new Document("newTitle", "newDescription") { Links = new List<Link> { new Link { Rel = "parent" ,Href = parentUrl } } }; _response = apiCall.Put(editUrl, putData); }
public void When_i_make_a_request_for_a_users_details() { _apiCall = new XmlApiCall( new[] {new HttpStatusCodeExceptionHandler()}); _apiCall.SetRequestAuthenticationMechanism(new OAuth2AuthenticationMechanism(Configuration.OAuth2Token)); _invalidUri = Configuration.BaseUrl + "users/haxxor"; }
public void When_the_file_metadata_is_POSTed() { _apiCall = new XmlApiCall(new[] {new HttpStatusCodeExceptionHandler()}); _apiCall.SetRequestAuthenticationMechanism(new OAuth2AuthenticationMechanism(Configuration.OAuth2Token)); }
public void When_i_make_a_request_for_a_users_details() { _apiCall = new XmlApiCall( new[] {new HttpStatusCodeExceptionHandler()}); _apiCall.SetRequestAuthenticationMechanism(new OAuth2AuthenticationMechanism("i am not authorised")); }
public void When_i_request_the_users_details() { var apiCall = new XmlApiCall(); apiCall.SetRequestAuthenticationMechanism(new OAuth2AuthenticationMechanism(Configuration.OAuth2Token)); _response = apiCall.Get(Configuration.GetSecureTestUserUri); }