public void Delete_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.Delete(321); // Then _client.Verify(c => c.BuildUri(It.Is <string>(s => s.Contains("321")), "")); }
public void Delete_Called_CallsDeleteOnClient() { // 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 resource.Delete(321); // Then _client.Verify(c => c.Delete(It.IsAny <Uri>())); }
public void Delete_Called_CallsDeleteOnClient() { // Given var response = new OrganizationResponse { Item = new Organization { Id = 1 } }; _client.Setup(b => b.Get<OrganizationResponse>( It.IsAny<Uri>(), It.IsAny<string>(), It.IsAny<string>())).Returns(response); var resource = new OrganizationResource(_client.Object); // When resource.Delete(321); // Then _client.Verify(c => c.Delete<object>(It.IsAny<Uri>(), It.IsAny<object>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>())); }
public void Delete_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.Delete(321); // Then _client.Verify(c => c.BuildUri(It.Is<string>(s => s.Contains("321")), "")); }