public void Get_Called_CallsBuildUriWithFieldId() { // Given _client.Setup(b => b.BuildUri(It.IsAny<string>(), It.Is<string>(s => s.Contains("321")))).Returns(new Uri("http://search")); var resource = new OrganizationResource(_client.Object); // When resource.Get(321); // Then _client.Verify(c => c.BuildUri(It.Is<string>(s => s.Contains("321")), "")); }
public void Get_Called_CallsBuildUriWithFieldId() { // Given _client.Setup(b => b.BuildUri(It.IsAny <string>(), It.Is <string>(s => s.Contains("321")))).Returns(new Uri("http://search")); var resource = new OrganizationResource(_client.Object); // When resource.Get(321); // Then _client.Verify(c => c.BuildUri(It.Is <string>(s => s.Contains("321")), "")); }
public void Get_Called_ReturnsResponse() { // Given var response = new OrganizationResponse { Item = new Organization { Id = 1 } }; _client.Setup(b => b.Get<OrganizationResponse>(It.IsAny<Uri>())).Returns(response); var resource = new OrganizationResource(_client.Object); // When var result = resource.Get(321); // Then Assert.That(result, Is.EqualTo(response)); }
public void Get_Called_ReturnsResponse() { // Given var response = new OrganizationResponse { Item = new Organization { Id = 1 } }; _client.Setup(b => b.Get <OrganizationResponse>(It.IsAny <Uri>())).Returns(response); var resource = new OrganizationResource(_client.Object); // When var result = resource.Get(321); // Then Assert.That(result, Is.EqualTo(response)); }