/// <summary>
        /// Unmarshaller the response from the service to the response class.
        /// </summary>
        /// <param name="context"></param>
        /// <returns></returns>
        public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context)
        {
            DeletePackageResponse response = new DeletePackageResponse();


            return(response);
        }
        public async Task DeletePackageAsync_ValidRequest_ShouldReturnDeletedPackage()
        {
            // Arrange
            var existingProject = new GetProjectPayload
            {
                Id = Guid.NewGuid().ToString(),
            };

            var existingPackage = new GetPackagePayload
            {
                Id = Guid.NewGuid().ToString(),
            };

            var expectedResponseContent =
                new StringContent(JsonConvert.SerializeObject(existingPackage, this.fixture.JsonSerializerSettings));

            var expectedResponse = new HttpResponseMessage
            {
                Content = expectedResponseContent,
            };

            var packageApi = this.fixture.GetPackageApi(expectedResponse);

            var deletePackageResponse = new DeletePackageResponse();

            // Act
            Func <Task> act = async() => deletePackageResponse = await packageApi.DeletePackageAsync(existingProject.Id, existingPackage.Id);

            // Assert
            await act.Should().NotThrowAsync();

            deletePackageResponse.Id.Should().Be(existingPackage.Id);
        }
Exemplo n.º 3
0
        public static DeletePackageResponse Unmarshall(UnmarshallerContext context)
        {
            DeletePackageResponse deletePackageResponse = new DeletePackageResponse();

            deletePackageResponse.HttpResponse = context.HttpResponse;
            deletePackageResponse.RequestId    = context.StringValue("DeletePackage.RequestId");

            return(deletePackageResponse);
        }
Exemplo n.º 4
0
        /// <summary>
        /// Unmarshaller the response from the service to the response class.
        /// </summary>
        /// <param name="context"></param>
        /// <returns></returns>
        public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context)
        {
            DeletePackageResponse response = new DeletePackageResponse();

            context.Read();
            int targetDepth = context.CurrentDepth;

            while (context.ReadAtDepth(targetDepth))
            {
                if (context.TestExpression("PackageDetails", targetDepth))
                {
                    var unmarshaller = PackageDetailsUnmarshaller.Instance;
                    response.PackageDetails = unmarshaller.Unmarshall(context);
                    continue;
                }
            }

            return(response);
        }