public void IntegrationTest_TrackViaClient_GetUsers()
        {
            TestHelper.EnsureProductionValuesBeforeRunningIntegrationTests();

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

            // Act
            List <User> users = client.getUsers(0, 25);

            // Assert
            users.ShouldNotBeNull();
            users.Count.ShouldBeGreaterThan(1);
        }
コード例 #2
0
        public void TrackViaClient_GetUsers_ShouldReturnListOfUsers()
        {
            // Assemble
            UserRecordSet userRecordSet = TestData.getUnitTestUserRecordSet1();

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

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

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

            // Act
            List <User> usersResponse = client.getUsers(0, 25);

            // Assert
            usersResponse
            .ShouldNotBeNull()
            .Count.ShouldEqual(userRecordSet.Count);
            usersResponse[0]
            .ShouldEqual(userRecordSet.Data[0]);
        }