Beispiel #1
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)
        {
            DeleteProfileResponse response = new DeleteProfileResponse();


            return(response);
        }
        public static DeleteProfileResponse Unmarshall(UnmarshallerContext context)
        {
            DeleteProfileResponse deleteProfileResponse = new DeleteProfileResponse();

            deleteProfileResponse.HttpResponse = context.HttpResponse;
            deleteProfileResponse.Code         = context.StringValue("DeleteProfile.Code");
            deleteProfileResponse.Data         = context.BooleanValue("DeleteProfile.Data");
            deleteProfileResponse.Message      = context.StringValue("DeleteProfile.Message");
            deleteProfileResponse.RequestId    = context.StringValue("DeleteProfile.RequestId");

            return(deleteProfileResponse);
        }
Beispiel #3
0
        public async Task DeleteProfileCommandTestAsync(string identityUserId, DeleteProfileResponse result)
        {
            DeleteProfileCommand request = new DeleteProfileCommand
            {
                IdentityUserId = identityUserId,
            };
            DeleteProfileCommandHandler handler = new DeleteProfileCommandHandler(_deleteFixture.Context);
            var expectedResult = await handler.Handle(request, new CancellationToken());

            Assert.Equal(expectedResult.IsSuccessful, result.IsSuccessful);
            if (result.IsSuccessful)
            {
                Profile profile = _deleteFixture.Context.Profiles.Find(expectedResult.Id);
                Assert.Null(profile);
            }
            Assert.Equal(expectedResult.Message, result.Message);
        }
        /// <summary>
        /// Unmarshaller the response from the service to the response class.
        /// </summary>
        /// <param name="context"></param>
        /// <returns></returns>
        public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context)
        {
            DeleteProfileResponse response = new DeleteProfileResponse();

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

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

            return(response);
        }