public void IntegrationTest_TrackViaClient_GetSingleView() { TestHelper.EnsureProductionValuesBeforeRunningIntegrationTests(string.IsNullOrWhiteSpace( IntegrationTestConfig.TRACKVIA_VIEWNAME_THATMATCHES_ATLEASTONEVIEW)); // Assemble TrackViaClient client = new TrackViaClient(IntegrationTestConfig.TRACKVIA_HOSTNAME, IntegrationTestConfig.TRACKVIA_USERNAME, IntegrationTestConfig.TRACKVIA_PASSWORD, IntegrationTestConfig.TRACKVIA_API_KEY); // Act View viewResult = client.getFirstMatchingView("My Accounts"); // Assert viewResult.ShouldNotBeNull(); viewResult.ApplicationName.ShouldNotBeEmpty(); viewResult.Id.ShouldNotBeEmpty(); viewResult.Name.ShouldEqual("My Accounts"); }
public void TrackViaClient_GetViewByName_ShouldReturnListOfMatchingView() { // Assemble List <View> views = new List <View>() { new View("1", "Default Contacts View", "Contact Management - IT"), new View("2", "Default Activities View", "Contact Management - IT") }; Mock <IAsyncHttpClientHelper> httpClient = new Mock <IAsyncHttpClientHelper>(); TestHelper.HttpClient_SetupGetRequest(HttpStatusCode.OK, views, httpClient); TrackViaClient client = new TrackViaClient(httpClient.Object, TestHelper.HostName_Fake, TestHelper.ApiKey_Fake); // Act View viewResponse = client.getFirstMatchingView("Default Contacts View"); // Assert viewResponse.ShouldNotBeNull().ShouldEqual(views[0]); }