Ejemplo n.º 1
0
        public void TrackViaClient_DeleteFile_ShouldReturnSuccess()
        {
            // Assemble
            Mock <IAsyncHttpClientHelper> httpClient = new Mock <IAsyncHttpClientHelper>();

            TaskCompletionSource <HttpClientResponse> asyncTaskResult = new TaskCompletionSource <HttpClientResponse>();

            asyncTaskResult.SetResult(new HttpClientResponse()
            {
                Content     = null,
                ContentType = HttpClientResponseTypes.none,
                StatusCode  = HttpStatusCode.NoContent
            });

            httpClient.Setup(x => x
                             .SendDeleteRequestAsync(It.IsAny <string>()))
            .Returns(asyncTaskResult.Task);

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

            // Act
            client.deleteFile(1L, 1L, "Test File");

            // Assert
        }