public void RemoveItemByIndexFromDictionary()
        {
            var data = new PropertyList();

            data.Add("XXX", "here!");
            Assert.AreEqual("here!", data["XXX"].StringValue);
            Assert.AreEqual(1, data.Count);

            data.RemoveAt(0);
            Assert.AreEqual(0, data.Count);
            Assert.IsFalse(data.Contains("XXX"));
        }
        public void ClearItems()
        {
            var data = new PropertyList();

            data.Add("A", 1);
            data.Add("B", 2);
            data.Add("C", 3);
            data.Add("D", 4);
            data.Add("E", 5);
            data.Add("F", 6);
            Assert.AreEqual(6, data.Count);

            data.Clear();
            Assert.AreEqual(0, data.Count);
            Assert.IsFalse(data.Contains("A"));
            Assert.IsFalse(data.Contains("B"));
            Assert.IsFalse(data.Contains("C"));
            Assert.IsFalse(data.Contains("D"));
            Assert.IsFalse(data.Contains("E"));
            Assert.IsFalse(data.Contains("F"));
        }
        public async Task Request_is_correct([Frozen] IHttpRestClient client, IHubSpotContactClient sut, string email, IReadOnlyList <ValuedProperty> properties, CreateOrUpdateResponse response)
        {
            Mock.Get(client)
            .Setup(p => p.SendAsync <PropertyList <ValuedProperty>, CreateOrUpdateResponse>(HttpMethod.Post, It.Is <string>(s => s.StartsWith($"/contacts/v1/contact/createOrUpdate/email/")), It.IsAny <PropertyList <ValuedProperty> >(), null))
            .ReturnsAsync(response);

            await sut.CreateOrUpdateByEmailAsync(email, properties);

            Mock.Get(client)
            .Verify(p => p.SendAsync <PropertyList <ValuedProperty>, CreateOrUpdateResponse>(HttpMethod.Post, $"/contacts/v1/contact/createOrUpdate/email/{email}", PropertyList.Contains(properties), null));
        }
Example #4
0
        public async Task Request_is_correct([Frozen] IHttpRestClient client, IHubSpotContactClient sut, long contactId, IReadOnlyList <ValuedProperty> properties)
        {
            await sut.UpdateByIdAsync(contactId, properties);

            Mock.Get(client)
            .Verify(p => p.SendAsync(HttpMethod.Post, $"/contacts/v1/contact/vid/{contactId}/profile", PropertyList.Contains(properties), null));
        }