public void IntegrationTest_TrackViaClient_FindDomainRecords_ShouldReturnListOfRecords() { TestHelper.EnsureProductionValuesBeforeRunningIntegrationTests(IntegrationTestConfig.TRACKVIA_VIEWID_DEMOSIMPLECRM_ACCOUNTSDEFAULTVIEW <= 0); // Assemble string searchCriteria = "A"; int startIndex = 0; int maxRecords = 2; TrackViaClient client = new TrackViaClient(IntegrationTestConfig.TRACKVIA_HOSTNAME, IntegrationTestConfig.TRACKVIA_USERNAME, IntegrationTestConfig.TRACKVIA_PASSWORD, IntegrationTestConfig.TRACKVIA_API_KEY); // Act DomainRecordSet <TestData.SimpleCrmContact> domainRecordSet = client.findRecords <TestData.SimpleCrmContact>( IntegrationTestConfig.TRACKVIA_VIEWID_DEMOSIMPLECRM_ACCOUNTSDEFAULTVIEW, searchCriteria, startIndex, maxRecords); // Assert domainRecordSet.ShouldNotBeNull(); domainRecordSet.Data.ShouldNotBeNull() .ShouldNotBeEmpty(); domainRecordSet.Count.ShouldEqual(2); // Assert for (int i = 0; i < domainRecordSet.Count; i++) { TestData.SimpleCrmContact Account = domainRecordSet.Data[i]; Account.ShouldNotBeNull(); Account.Id.ShouldBeGreaterThan(0); Account.AccountName.ShouldNotBeNull().ShouldNotBeEmpty(); Account.PrimaryContact.ShouldNotBeNull().ShouldNotBeEmpty(); } }
public void IntegrationTest_TrackViaClient_GetDomainRecords_SimpleCrmAccounts() { TestHelper.EnsureProductionValuesBeforeRunningIntegrationTests(IntegrationTestConfig.TRACKVIA_VIEWID_DEMOSIMPLECRM_ACCOUNTSDEFAULTVIEW <= 0); // Assemble TrackViaClient client = new TrackViaClient(IntegrationTestConfig.TRACKVIA_HOSTNAME, IntegrationTestConfig.TRACKVIA_USERNAME, IntegrationTestConfig.TRACKVIA_PASSWORD, IntegrationTestConfig.TRACKVIA_API_KEY); // Act DomainRecordSet <TestData.SimpleCrmContact> domainRecordSet = client.getRecords <TestData.SimpleCrmContact>( IntegrationTestConfig.TRACKVIA_VIEWID_DEMOSIMPLECRM_ACCOUNTSDEFAULTVIEW); // Assert domainRecordSet.ShouldNotBeNull() .Data.ShouldNotBeNull().ShouldNotBeEmpty(); domainRecordSet.Count.ShouldBeGreaterThan(1); domainRecordSet.Data.Count.ShouldEqual(domainRecordSet.Count); for (int i = 0; i < domainRecordSet.Count; i++) { TestData.SimpleCrmContact Account = domainRecordSet.Data[i]; Account.ShouldNotBeNull(); Account.Id.ShouldBeGreaterThan(0); Account.AccountName.ShouldNotBeNull().ShouldNotBeEmpty(); Account.PrimaryContact.ShouldNotBeNull().ShouldNotBeEmpty(); } }
public void IntegrationTest_TrackViaClient_CreateDomainRecords_SimpleCrmAccounts() { TestHelper.EnsureProductionValuesBeforeRunningIntegrationTests(IntegrationTestConfig.TRACKVIA_VIEWID_DEMOSIMPLECRM_ACCOUNTSDEFAULTVIEW <= 0); // Assemble TrackViaClient client = new TrackViaClient(IntegrationTestConfig.TRACKVIA_HOSTNAME, IntegrationTestConfig.TRACKVIA_USERNAME, IntegrationTestConfig.TRACKVIA_PASSWORD, IntegrationTestConfig.TRACKVIA_API_KEY); TestData.SimpleCrmContact contact = TestData.IntegrationTest_SimpleCrmContact_GetCreate(); DomainRecordDataBatch <TestData.SimpleCrmContact> batch = new DomainRecordDataBatch <TestData.SimpleCrmContact>(new TestData.SimpleCrmContact[] { contact }); // Act DomainRecordSet <TestData.SimpleCrmContact> domainRecordSet = client.createRecords <TestData.SimpleCrmContact>( IntegrationTestConfig.TRACKVIA_VIEWID_DEMOSIMPLECRM_ACCOUNTSDEFAULTVIEW, batch); // Assert domainRecordSet.ShouldNotBeNull() .Data.ShouldNotBeNull().ShouldNotBeEmpty(); domainRecordSet.Count.ShouldEqual(1); domainRecordSet.Data.Count.ShouldEqual(domainRecordSet.Count); for (int i = 0; i < domainRecordSet.Count; i++) { TestData.SimpleCrmContact Account = domainRecordSet.Data[i]; Account.ShouldNotBeNull(); Account.Id.ShouldBeGreaterThan(0); Account.AccountName.ShouldNotBeNull().ShouldEqual(contact.AccountName); Account.PrimaryContact.ShouldNotBeNull().ShouldEqual(contact.PrimaryContact); Account.ContactPhone.ShouldNotBeNull().ShouldEqual(contact.ContactPhone); Account.ContactEmail.ShouldNotBeNull().ShouldEqual(contact.ContactEmail); Account.Address.ShouldNotBeNull().ShouldEqual(contact.Address); Account.City.ShouldNotBeNull().ShouldEqual(contact.City); Account.State.ShouldNotBeNull().ShouldEqual(contact.State); Account.ZipCode.ShouldNotBeNull().ShouldEqual(contact.ZipCode); } }