예제 #1
0
        public void ListProvisionedConcurrencyConfigsTest__OnlyUsedOnce()
        {
            var request = InstantiateClassGenerator.Execute <ListProvisionedConcurrencyConfigsRequest>();

            var response = InstantiateClassGenerator.Execute <ListProvisionedConcurrencyConfigsResponse>();

            response.NextMarker = null;

            _mockClient.Setup(x => x.ListProvisionedConcurrencyConfigs(request)).Returns(response);
            var paginator = _mockClient.Object.Paginators.ListProvisionedConcurrencyConfigs(request);

            // Should work the first time
            paginator.Responses.ToList();

            // Second time should throw an exception
            paginator.Responses.ToList();
        }
        public void SearchProvisionedProductsTest__OnlyUsedOnce()
        {
            var request = InstantiateClassGenerator.Execute <SearchProvisionedProductsRequest>();

            var response = InstantiateClassGenerator.Execute <SearchProvisionedProductsResponse>();

            response.NextPageToken = null;

            _mockClient.Setup(x => x.SearchProvisionedProducts(request)).Returns(response);
            var paginator = _mockClient.Object.Paginators.SearchProvisionedProducts(request);

            // Should work the first time
            paginator.Responses.ToList();

            // Second time should throw an exception
            paginator.Responses.ToList();
        }
        public void DescribeDBClusterEndpointsTest__OnlyUsedOnce()
        {
            var request = InstantiateClassGenerator.Execute <DescribeDBClusterEndpointsRequest>();

            var response = InstantiateClassGenerator.Execute <DescribeDBClusterEndpointsResponse>();

            response.Marker = null;

            _mockClient.Setup(x => x.DescribeDBClusterEndpoints(request)).Returns(response);
            var paginator = _mockClient.Object.Paginators.DescribeDBClusterEndpoints(request);

            // Should work the first time
            paginator.Responses.ToList();

            // Second time should throw an exception
            paginator.Responses.ToList();
        }
        public void SelectAggregateResourceConfigTest__OnlyUsedOnce()
        {
            var request = InstantiateClassGenerator.Execute <SelectAggregateResourceConfigRequest>();

            var response = InstantiateClassGenerator.Execute <SelectAggregateResourceConfigResponse>();

            response.NextToken = null;

            _mockClient.Setup(x => x.SelectAggregateResourceConfig(request)).Returns(response);
            var paginator = _mockClient.Object.Paginators.SelectAggregateResourceConfig(request);

            // Should work the first time
            paginator.Responses.ToList();

            // Second time should throw an exception
            paginator.Responses.ToList();
        }
예제 #5
0
        public void ChangeMessageVisibilityBatchMarshallTest()
        {
            var operation = service_model.FindOperation("ChangeMessageVisibilityBatch");

            var request = InstantiateClassGenerator.Execute<ChangeMessageVisibilityBatchRequest>();
            var marshaller = new ChangeMessageVisibilityBatchRequestMarshaller();
            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 = ChangeMessageVisibilityBatchResponseUnmarshaller.Instance.Unmarshall(context)
                as ChangeMessageVisibilityBatchResponse;   
            InstantiateClassGenerator.ValidateObjectFullyInstantiated(response);       
        }
        public void ListStoredQueriesTest__OnlyUsedOnce()
        {
            var request = InstantiateClassGenerator.Execute <ListStoredQueriesRequest>();

            var response = InstantiateClassGenerator.Execute <ListStoredQueriesResponse>();

            response.NextToken = null;

            _mockClient.Setup(x => x.ListStoredQueries(request)).Returns(response);
            var paginator = _mockClient.Object.Paginators.ListStoredQueries(request);

            // Should work the first time
            paginator.Responses.ToList();

            // Second time should throw an exception
            paginator.Responses.ToList();
        }
        public void GetFindingsReportAccountSummaryTest__OnlyUsedOnce()
        {
            var request = InstantiateClassGenerator.Execute <GetFindingsReportAccountSummaryRequest>();

            var response = InstantiateClassGenerator.Execute <GetFindingsReportAccountSummaryResponse>();

            response.NextToken = null;

            _mockClient.Setup(x => x.GetFindingsReportAccountSummary(request)).Returns(response);
            var paginator = _mockClient.Object.Paginators.GetFindingsReportAccountSummary(request);

            // Should work the first time
            paginator.Responses.ToList();

            // Second time should throw an exception
            paginator.Responses.ToList();
        }
예제 #8
0
        public void ListDeadLetterSourceQueuesMarshallTest()
        {
            var operation = service_model.FindOperation("ListDeadLetterSourceQueues");

            var request = InstantiateClassGenerator.Execute<ListDeadLetterSourceQueuesRequest>();
            var marshaller = new ListDeadLetterSourceQueuesRequestMarshaller();
            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 = ListDeadLetterSourceQueuesResponseUnmarshaller.Instance.Unmarshall(context)
                as ListDeadLetterSourceQueuesResponse;   
            InstantiateClassGenerator.ValidateObjectFullyInstantiated(response);       
        }
        public void ListServiceActionsForProvisioningArtifactTest__OnlyUsedOnce()
        {
            var request = InstantiateClassGenerator.Execute <ListServiceActionsForProvisioningArtifactRequest>();

            var response = InstantiateClassGenerator.Execute <ListServiceActionsForProvisioningArtifactResponse>();

            response.NextPageToken = null;

            _mockClient.Setup(x => x.ListServiceActionsForProvisioningArtifact(request)).Returns(response);
            var paginator = _mockClient.Object.Paginators.ListServiceActionsForProvisioningArtifact(request);

            // Should work the first time
            paginator.Responses.ToList();

            // Second time should throw an exception
            paginator.Responses.ToList();
        }
예제 #10
0
        public void DescribeInboundCrossClusterSearchConnectionsTest__OnlyUsedOnce()
        {
            var request = InstantiateClassGenerator.Execute <DescribeInboundCrossClusterSearchConnectionsRequest>();

            var response = InstantiateClassGenerator.Execute <DescribeInboundCrossClusterSearchConnectionsResponse>();

            response.NextToken = null;

            _mockClient.Setup(x => x.DescribeInboundCrossClusterSearchConnections(request)).Returns(response);
            var paginator = _mockClient.Object.Paginators.DescribeInboundCrossClusterSearchConnections(request);

            // Should work the first time
            paginator.Responses.ToList();

            // Second time should throw an exception
            paginator.Responses.ToList();
        }
예제 #11
0
        public void ListAssociatedApprovalRuleTemplatesForRepositoryTest__OnlyUsedOnce()
        {
            var request = InstantiateClassGenerator.Execute <ListAssociatedApprovalRuleTemplatesForRepositoryRequest>();

            var response = InstantiateClassGenerator.Execute <ListAssociatedApprovalRuleTemplatesForRepositoryResponse>();

            response.NextToken = null;

            _mockClient.Setup(x => x.ListAssociatedApprovalRuleTemplatesForRepository(request)).Returns(response);
            var paginator = _mockClient.Object.Paginators.ListAssociatedApprovalRuleTemplatesForRepository(request);

            // Should work the first time
            paginator.Responses.ToList();

            // Second time should throw an exception
            paginator.Responses.ToList();
        }
        public void ListHealthChecksTest__OnlyUsedOnce()
        {
            var request = InstantiateClassGenerator.Execute <ListHealthChecksRequest>();

            var response = InstantiateClassGenerator.Execute <ListHealthChecksResponse>();

            response.IsTruncated = false;

            _mockClient.Setup(x => x.ListHealthChecks(request)).Returns(response);
            var paginator = _mockClient.Object.Paginators.ListHealthChecks(request);

            // Should work the first time
            paginator.Responses.ToList();

            // Second time should throw an exception
            paginator.Responses.ToList();
        }
        public void ApplyEnvironmentManagedActionMarshallTest()
        {
            var operation = service_model.FindOperation("ApplyEnvironmentManagedAction");

            var request         = InstantiateClassGenerator.Execute <ApplyEnvironmentManagedActionRequest>();
            var marshaller      = new ApplyEnvironmentManagedActionRequestMarshaller();
            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        = ApplyEnvironmentManagedActionResponseUnmarshaller.Instance.Unmarshall(context)
                                  as ApplyEnvironmentManagedActionResponse;

            InstantiateClassGenerator.ValidateObjectFullyInstantiated(response);
        }
예제 #14
0
        public void ModifyDBClusterSnapshotAttributeMarshallTest()
        {
            var operation = service_model.FindOperation("ModifyDBClusterSnapshotAttribute");

            var request         = InstantiateClassGenerator.Execute <ModifyDBClusterSnapshotAttributeRequest>();
            var marshaller      = new ModifyDBClusterSnapshotAttributeRequestMarshaller();
            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        = ModifyDBClusterSnapshotAttributeResponseUnmarshaller.Instance.Unmarshall(context)
                                  as ModifyDBClusterSnapshotAttributeResponse;

            InstantiateClassGenerator.ValidateObjectFullyInstantiated(response);
        }
예제 #15
0
        public void DescribeEngineDefaultClusterParametersMarshallTest()
        {
            var operation = service_model.FindOperation("DescribeEngineDefaultClusterParameters");

            var request         = InstantiateClassGenerator.Execute <DescribeEngineDefaultClusterParametersRequest>();
            var marshaller      = new DescribeEngineDefaultClusterParametersRequestMarshaller();
            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        = DescribeEngineDefaultClusterParametersResponseUnmarshaller.Instance.Unmarshall(context)
                                  as DescribeEngineDefaultClusterParametersResponse;

            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);
        }
예제 #17
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-session-attributes", Convert.ToBase64String(Encoding.UTF8.GetBytes("x-amz-lex-session-attributes_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.Add("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);
        }