public void IntegrationTest_TrackViaClient_GetRecord_SimpleCrmAccount()
        {
            TestHelper.EnsureProductionValuesBeforeRunningIntegrationTests(IntegrationTestConfig.TRACKVIA_VIEWID_DEMOSIMPLECRM_ACCOUNTSDEFAULTVIEW <= 0 ||
                                                                           IntegrationTestConfig.TRACKVIA_VIEWID_DEMOSIMPLECRM_ACCOUNTSDEFAULTVIEW_VALIDACCOUNTRECORDID <= 0);

            // Assemble
            TrackViaClient client = new TrackViaClient(IntegrationTestConfig.TRACKVIA_HOSTNAME, IntegrationTestConfig.TRACKVIA_USERNAME,
                                                       IntegrationTestConfig.TRACKVIA_PASSWORD, IntegrationTestConfig.TRACKVIA_API_KEY);

            // Act
            Record record = client.getRecord(IntegrationTestConfig.TRACKVIA_VIEWID_DEMOSIMPLECRM_ACCOUNTSDEFAULTVIEW,
                                             IntegrationTestConfig.TRACKVIA_VIEWID_DEMOSIMPLECRM_ACCOUNTSDEFAULTVIEW_VALIDACCOUNTRECORDID);

            // Assert
            record.ShouldNotBeNull();
            record.Data.ShouldNotBeNull();
            record.Data.Id.ShouldEqual(IntegrationTestConfig.TRACKVIA_VIEWID_DEMOSIMPLECRM_ACCOUNTSDEFAULTVIEW_VALIDACCOUNTRECORDID);
        }
Exemple #2
0
        public void TrackViaClient_GetRecordAsDomainClass_ShouldReturnRecordAsType()
        {
            // Assemble
            Record record = TestData.getUnitTestRecord1();

            Mock <IAsyncHttpClientHelper> httpClient = new Mock <IAsyncHttpClientHelper>();

            TestHelper.HttpClient_SetupGetRequest(HttpStatusCode.OK, record, httpClient);

            TrackViaClient client = new TrackViaClient(httpClient.Object, TestHelper.HostName_Fake, TestHelper.ApiKey_Fake);

            // Act
            DomainRecord <TestData.Contact> contactRecord = client.getRecord <TestData.Contact>(1, 1);

            // Assert
            contactRecord.ShouldNotBeNull();
            contactRecord.Data.ShouldNotBeNull();
            contactRecord.Data.Id.ShouldEqual(record.Data.Id);
        }
Exemple #3
0
        public void TrackViaClient_GetRecord_ShouldReturnRecord()
        {
            // Assemble
            Record record = TestData.getUnitTestRecord1();

            Mock <IAsyncHttpClientHelper> httpClient = new Mock <IAsyncHttpClientHelper>();

            TestHelper.HttpClient_SetupGetRequest(HttpStatusCode.OK, record, httpClient);

            TrackViaClient client = new TrackViaClient(httpClient.Object, TestHelper.HostName_Fake, TestHelper.ApiKey_Fake);

            // Act
            Record recordResponse = client.getRecord(1, 1);

            // Assert
            recordResponse.ShouldNotBeNull();
            recordResponse.Data.ShouldNotBeNull();
            recordResponse.Data.Id.ShouldEqual(1L);
        }