public void Post_CalledWithItem_ReturnsReponse() { // Given var response = new OrganizationResponse { Item = new Organization { Name = "blah blah" } }; var request = new OrganizationRequest { Item = new Organization { Name = "blah blah" } }; _client.Setup(b => b.Post <OrganizationResponse>( It.IsAny <Uri>(), request, "application/json", It.IsAny <string>(), It.IsAny <string>())) .Returns(response); var resource = new OrganizationResource(_client.Object); // When var result = resource.Post(request); // Then Assert.That(result, Is.EqualTo(response)); }
public void Post_Called_BuildsUri() { // Given var request = new OrganizationRequest { Item = new Organization { Name = "blah blah" } }; var resource = new OrganizationResource(_client.Object); // When resource.Post(request); // Then _client.Setup(b => b.BuildUri(It.IsAny <string>(), "")); }
public void Post_CalledWithItem_ReturnsReponse() { // Given var response = new OrganizationResponse { Item = new Organization { Name = "blah blah" } }; var request = new OrganizationRequest { Item = new Organization { Name = "blah blah" } }; _client.Setup(b => b.Post<OrganizationResponse>( It.IsAny<Uri>(), request, "application/json", It.IsAny<string>(), It.IsAny<string>())) .Returns(response); var resource = new OrganizationResource(_client.Object); // When var result = resource.Post(request); // Then Assert.That(result, Is.EqualTo(response)); }
public void Post_Called_BuildsUri() { // Given var request = new OrganizationRequest { Item = new Organization { Name = "blah blah" } }; var resource = new OrganizationResource(_client.Object); // When resource.Post(request); // Then _client.Setup(b => b.BuildUri(It.IsAny<string>(), "")); }