public void DescribeEnvironmentHealthMarshallTest()
        {
            var operation = service_model.FindOperation("DescribeEnvironmentHealth");

            var request         = InstantiateClassGenerator.Execute <DescribeEnvironmentHealthRequest>();
            var marshaller      = new DescribeEnvironmentHealthRequestMarshaller();
            var internalRequest = marshaller.Marshall(request);
            var validator       = new AWSQueryValidator(internalRequest.Parameters, request, service_model, operation);

            validator.Validate();


            var payloadResponse = new XmlSampleGenerator(service_model, operation).Execute();
            var context         = new XmlUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, null);
            var response        = DescribeEnvironmentHealthResponseUnmarshaller.Instance.Unmarshall(context)
                                  as DescribeEnvironmentHealthResponse;

            InstantiateClassGenerator.ValidateObjectFullyInstantiated(response);
        }
Esempio n. 2
0
        public void UpdateApplicationResourceLifecycleMarshallTest()
        {
            var operation = service_model.FindOperation("UpdateApplicationResourceLifecycle");

            var request         = InstantiateClassGenerator.Execute <UpdateApplicationResourceLifecycleRequest>();
            var marshaller      = new UpdateApplicationResourceLifecycleRequestMarshaller();
            var internalRequest = marshaller.Marshall(request);
            var validator       = new AWSQueryValidator(internalRequest.Parameters, request, service_model, operation);

            validator.Validate();


            var payloadResponse = new XmlSampleGenerator(service_model, operation).Execute();
            var context         = new XmlUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, null);
            var response        = UpdateApplicationResourceLifecycleResponseUnmarshaller.Instance.Unmarshall(context)
                                  as UpdateApplicationResourceLifecycleResponse;

            InstantiateClassGenerator.ValidateObjectFullyInstantiated(response);
        }
Esempio n. 3
0
        public void ListAvailableSolutionStacksMarshallTest()
        {
            var operation = service_model.FindOperation("ListAvailableSolutionStacks");

            var request         = InstantiateClassGenerator.Execute <ListAvailableSolutionStacksRequest>();
            var marshaller      = new ListAvailableSolutionStacksRequestMarshaller();
            var internalRequest = marshaller.Marshall(request);
            var validator       = new AWSQueryValidator(internalRequest.Parameters, request, service_model, operation);

            validator.Validate();


            var payloadResponse = new XmlSampleGenerator(service_model, operation).Execute();
            var context         = new XmlUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, null);
            var response        = ListAvailableSolutionStacksResponseUnmarshaller.Instance.Unmarshall(context)
                                  as ListAvailableSolutionStacksResponse;

            InstantiateClassGenerator.ValidateObjectFullyInstantiated(response);
        }
        public void AssumeRoleWithWebIdentityMarshallTest()
        {
            var operation = service_model.FindOperation("AssumeRoleWithWebIdentity");

            var request         = InstantiateClassGenerator.Execute <AssumeRoleWithWebIdentityRequest>();
            var marshaller      = new AssumeRoleWithWebIdentityRequestMarshaller();
            var internalRequest = marshaller.Marshall(request);
            var validator       = new AWSQueryValidator(internalRequest.Parameters, request, service_model, operation);

            validator.Validate();


            var payloadResponse = new XmlSampleGenerator(service_model, operation).Execute();
            var context         = new XmlUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, null);
            var response        = AssumeRoleWithWebIdentityResponseUnmarshaller.Instance.Unmarshall(context)
                                  as AssumeRoleWithWebIdentityResponse;

            InstantiateClassGenerator.ValidateObjectFullyInstantiated(response);
        }
Esempio n. 5
0
        public void RevokeCacheSecurityGroupIngressMarshallTest()
        {
            var operation = service_model.FindOperation("RevokeCacheSecurityGroupIngress");

            var request         = InstantiateClassGenerator.Execute <RevokeCacheSecurityGroupIngressRequest>();
            var marshaller      = new RevokeCacheSecurityGroupIngressRequestMarshaller();
            var internalRequest = marshaller.Marshall(request);
            var validator       = new AWSQueryValidator(internalRequest.Parameters, request, service_model, operation);

            validator.Validate();


            var payloadResponse = new XmlSampleGenerator(service_model, operation).Execute();
            var context         = new XmlUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, null);
            var response        = RevokeCacheSecurityGroupIngressResponseUnmarshaller.Instance.Unmarshall(context)
                                  as RevokeCacheSecurityGroupIngressResponse;

            InstantiateClassGenerator.ValidateObjectFullyInstantiated(response);
        }
Esempio n. 6
0
        public void PurchaseReservedCacheNodesOfferingMarshallTest()
        {
            var operation = service_model.FindOperation("PurchaseReservedCacheNodesOffering");

            var request         = InstantiateClassGenerator.Execute <PurchaseReservedCacheNodesOfferingRequest>();
            var marshaller      = new PurchaseReservedCacheNodesOfferingRequestMarshaller();
            var internalRequest = marshaller.Marshall(request);
            var validator       = new AWSQueryValidator(internalRequest.Parameters, request, service_model, operation);

            validator.Validate();


            var payloadResponse = new XmlSampleGenerator(service_model, operation).Execute();
            var context         = new XmlUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, null);
            var response        = PurchaseReservedCacheNodesOfferingResponseUnmarshaller.Instance.Unmarshall(context)
                                  as PurchaseReservedCacheNodesOfferingResponse;

            InstantiateClassGenerator.ValidateObjectFullyInstantiated(response);
        }
        public void GetComplianceSummaryByConfigRuleMarshallTest()
        {
            var request = InstantiateClassGenerator.Execute<GetComplianceSummaryByConfigRuleRequest>();
            var marshaller = new GetComplianceSummaryByConfigRuleRequestMarshaller();

            var internalRequest = marshaller.Marshall(request);
            var webResponse = new WebResponseData
            {
                Headers = {
                    {"x-amzn-RequestId", Guid.NewGuid().ToString()},
                    {"x-amz-crc32","0"}
                }
            };
            var jsonResponse = new JsonSampleGenerator(service_model, service_model.FindOperation("GetComplianceSummaryByConfigRule").ResponseStructure).Execute();
            webResponse.Headers.Add("Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString());
            UnmarshallerContext context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), false, webResponse);
            var response = GetComplianceSummaryByConfigRuleResponseUnmarshaller.Instance.Unmarshall(context)
                as GetComplianceSummaryByConfigRuleResponse;
            InstantiateClassGenerator.ValidateObjectFullyInstantiated(response);
        }
Esempio n. 8
0
        public void PostContentMarshallTest()
        {
            var operation = service_model.FindOperation("PostContent");

            var request    = InstantiateClassGenerator.Execute <PostContentRequest>();
            var marshaller = new PostContentRequestMarshaller();

            var internalRequest = marshaller.Marshall(request);

            TestTools.RequestValidator.Validate("PostContent", request, internalRequest, service_model);

            var webResponse = new WebResponseData
            {
                Headers =
                {
                    { "Content-Type",                 "Content-Type_Value"                                                                 },
                    { "x-amz-lex-dialog-state",       "x-amz-lex-dialog-state_Value"                                                       },
                    { "x-amz-lex-input-transcript",   "x-amz-lex-input-transcript_Value"                                                   },
                    { "x-amz-lex-intent-name",        "x-amz-lex-intent-name_Value"                                                        },
                    { "x-amz-lex-message",            "x-amz-lex-message_Value"                                                            },
                    { "x-amz-lex-message-format",     "x-amz-lex-message-format_Value"                                                     },
                    { "x-amz-lex-sentiment",          "x-amz-lex-sentiment_Value"                                                          },
                    { "x-amz-lex-session-attributes", Convert.ToBase64String(Encoding.UTF8.GetBytes("x-amz-lex-session-attributes_Value")) },
                    { "x-amz-lex-session-id",         "x-amz-lex-session-id_Value"                                                         },
                    { "x-amz-lex-slots",              Convert.ToBase64String(Encoding.UTF8.GetBytes("x-amz-lex-slots_Value"))              },
                    { "x-amz-lex-slot-to-elicit",     "x-amz-lex-slot-to-elicit_Value"                                                     },
                    { "x-amzn-RequestId",             Guid.NewGuid().ToString()                                                            },
                    { "x-amz-crc32",                  "0"                                                                                  }
                }
            };

            var payloadResponse = new JsonSampleGenerator(service_model, operation.ResponseStructure).Execute();

            webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString();
            var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, webResponse);
            ResponseUnmarshaller unmarshaller = PostContentResponseUnmarshaller.Instance;
            var response = unmarshaller.Unmarshall(context)
                           as PostContentResponse;

            InstantiateClassGenerator.ValidateObjectFullyInstantiated(response);
        }
        public void ListDiscoveredResourcesMarshallTest()
        {
            var request = InstantiateClassGenerator.Execute<ListDiscoveredResourcesRequest>();
            var marshaller = new ListDiscoveredResourcesRequestMarshaller();

            var internalRequest = marshaller.Marshall(request);
            var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content);                        
            Comparer.CompareObjectToJson<ListDiscoveredResourcesRequest>(request,jsonRequest);

            var webResponse = new WebResponseData
            {
                Headers = {
                    {"x-amzn-RequestId", Guid.NewGuid().ToString()},
                    {"x-amz-crc32","0"}
                }
            };
            var jsonResponse = new JsonSampleGenerator(service_model, service_model.FindOperation("ListDiscoveredResources").ResponseStructure).Execute();
            webResponse.Headers.Add("Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString());
            UnmarshallerContext context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), false, webResponse);
            var response = ListDiscoveredResourcesResponseUnmarshaller.Instance.Unmarshall(context)
                as ListDiscoveredResourcesResponse;
            InstantiateClassGenerator.ValidateObjectFullyInstantiated(response);
        }
        public void GetObjectMarshallTest()
        {
            var operation = service_model.FindOperation("GetObject");

            var request    = InstantiateClassGenerator.Execute <GetObjectRequest>();
            var marshaller = new GetObjectRequestMarshaller();

            var internalRequest = marshaller.Marshall(request);

            TestTools.RequestValidator.Validate("GetObject", request, internalRequest, service_model);

            var webResponse = new WebResponseData
            {
                Headers =
                {
                    { "Cache-Control",    "Cache-Control_Value"                                },
                    { "Content-Length",   long.MaxValue.ToString(CultureInfo.InvariantCulture) },
                    { "Content-Range",    "Content-Range_Value"                                },
                    { "Content-Type",     "Content-Type_Value"                                 },
                    { "ETag",             "ETag_Value"                                         },
                    { "Last-Modified",    ValidatorUtils.GetTestDate(TimestampFormat.RFC822)   },
                    { "x-amzn-RequestId", Guid.NewGuid().ToString()                            },
                    { "x-amz-crc32",      "0"                                                  }
                }
            };

            var payloadResponse = new JsonSampleGenerator(service_model, operation.ResponseStructure).Execute();

            webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString();
            var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, webResponse);
            ResponseUnmarshaller unmarshaller = GetObjectResponseUnmarshaller.Instance;
            var response = unmarshaller.Unmarshall(context)
                           as GetObjectResponse;

            InstantiateClassGenerator.ValidateObjectFullyInstantiated(response);
        }