/* * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ /* * Do not modify this file. This file is generated from the xray-2016-04-12.normal.json service model. */ using System; using System.Globalization; using System.IO; using System.Linq; using System.Text; using Microsoft.VisualStudio.TestTools.UnitTesting; using Amazon.XRay; using Amazon.XRay.Model; using Amazon.XRay.Model.Internal.MarshallTransformations; using Amazon.Runtime.Internal.Transform; using Amazon.Util; using ServiceClientGenerator; using AWSSDK_DotNet35.UnitTests.TestTools; namespace AWSSDK_DotNet35.UnitTests.Marshalling { [TestClass] public partial class XRayMarshallingTests { static readonly ServiceModel service_model = Utils.LoadServiceModel("xray"); [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("XRay")] public void BatchGetTracesMarshallTest() { var operation = service_model.FindOperation("BatchGetTraces"); var request = InstantiateClassGenerator.Execute(); var marshaller = new BatchGetTracesRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("BatchGetTraces", request, internalRequest, service_model); var webResponse = new WebResponseData { Headers = { {"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 = BatchGetTracesResponseUnmarshaller.Instance; var response = unmarshaller.Unmarshall(context) as BatchGetTracesResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("XRay")] public void BatchGetTraces_InvalidRequestExceptionMarshallTest() { var operation = service_model.FindOperation("BatchGetTraces"); var request = InstantiateClassGenerator.Execute(); var marshaller = new BatchGetTracesRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("BatchGetTraces", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("InvalidRequestException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InvalidRequestException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = BatchGetTracesResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("XRay")] public void BatchGetTraces_ThrottledExceptionMarshallTest() { var operation = service_model.FindOperation("BatchGetTraces"); var request = InstantiateClassGenerator.Execute(); var marshaller = new BatchGetTracesRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("BatchGetTraces", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ThrottledException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ThrottledException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = BatchGetTracesResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("XRay")] public void CreateGroupMarshallTest() { var operation = service_model.FindOperation("CreateGroup"); var request = InstantiateClassGenerator.Execute(); var marshaller = new CreateGroupRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("CreateGroup", request, internalRequest, service_model); var webResponse = new WebResponseData { Headers = { {"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 = CreateGroupResponseUnmarshaller.Instance; var response = unmarshaller.Unmarshall(context) as CreateGroupResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("XRay")] public void CreateGroup_InvalidRequestExceptionMarshallTest() { var operation = service_model.FindOperation("CreateGroup"); var request = InstantiateClassGenerator.Execute(); var marshaller = new CreateGroupRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("CreateGroup", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("InvalidRequestException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InvalidRequestException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = CreateGroupResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("XRay")] public void CreateGroup_ThrottledExceptionMarshallTest() { var operation = service_model.FindOperation("CreateGroup"); var request = InstantiateClassGenerator.Execute(); var marshaller = new CreateGroupRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("CreateGroup", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ThrottledException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ThrottledException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = CreateGroupResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("XRay")] public void CreateSamplingRuleMarshallTest() { var operation = service_model.FindOperation("CreateSamplingRule"); var request = InstantiateClassGenerator.Execute(); var marshaller = new CreateSamplingRuleRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("CreateSamplingRule", request, internalRequest, service_model); var webResponse = new WebResponseData { Headers = { {"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 = CreateSamplingRuleResponseUnmarshaller.Instance; var response = unmarshaller.Unmarshall(context) as CreateSamplingRuleResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("XRay")] public void CreateSamplingRule_InvalidRequestExceptionMarshallTest() { var operation = service_model.FindOperation("CreateSamplingRule"); var request = InstantiateClassGenerator.Execute(); var marshaller = new CreateSamplingRuleRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("CreateSamplingRule", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("InvalidRequestException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InvalidRequestException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = CreateSamplingRuleResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("XRay")] public void CreateSamplingRule_RuleLimitExceededExceptionMarshallTest() { var operation = service_model.FindOperation("CreateSamplingRule"); var request = InstantiateClassGenerator.Execute(); var marshaller = new CreateSamplingRuleRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("CreateSamplingRule", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("RuleLimitExceededException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","RuleLimitExceededException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = CreateSamplingRuleResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("XRay")] public void CreateSamplingRule_ThrottledExceptionMarshallTest() { var operation = service_model.FindOperation("CreateSamplingRule"); var request = InstantiateClassGenerator.Execute(); var marshaller = new CreateSamplingRuleRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("CreateSamplingRule", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ThrottledException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ThrottledException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = CreateSamplingRuleResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("XRay")] public void DeleteGroupMarshallTest() { var operation = service_model.FindOperation("DeleteGroup"); var request = InstantiateClassGenerator.Execute(); var marshaller = new DeleteGroupRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("DeleteGroup", request, internalRequest, service_model); var webResponse = new WebResponseData { Headers = { {"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 = DeleteGroupResponseUnmarshaller.Instance; var response = unmarshaller.Unmarshall(context) as DeleteGroupResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("XRay")] public void DeleteGroup_InvalidRequestExceptionMarshallTest() { var operation = service_model.FindOperation("DeleteGroup"); var request = InstantiateClassGenerator.Execute(); var marshaller = new DeleteGroupRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("DeleteGroup", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("InvalidRequestException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InvalidRequestException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = DeleteGroupResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("XRay")] public void DeleteGroup_ThrottledExceptionMarshallTest() { var operation = service_model.FindOperation("DeleteGroup"); var request = InstantiateClassGenerator.Execute(); var marshaller = new DeleteGroupRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("DeleteGroup", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ThrottledException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ThrottledException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = DeleteGroupResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("XRay")] public void DeleteResourcePolicyMarshallTest() { var operation = service_model.FindOperation("DeleteResourcePolicy"); var request = InstantiateClassGenerator.Execute(); var marshaller = new DeleteResourcePolicyRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("DeleteResourcePolicy", request, internalRequest, service_model); var webResponse = new WebResponseData { Headers = { {"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 = DeleteResourcePolicyResponseUnmarshaller.Instance; var response = unmarshaller.Unmarshall(context) as DeleteResourcePolicyResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("XRay")] public void DeleteResourcePolicy_InvalidPolicyRevisionIdExceptionMarshallTest() { var operation = service_model.FindOperation("DeleteResourcePolicy"); var request = InstantiateClassGenerator.Execute(); var marshaller = new DeleteResourcePolicyRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("DeleteResourcePolicy", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("InvalidPolicyRevisionIdException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InvalidPolicyRevisionIdException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = DeleteResourcePolicyResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("XRay")] public void DeleteResourcePolicy_InvalidRequestExceptionMarshallTest() { var operation = service_model.FindOperation("DeleteResourcePolicy"); var request = InstantiateClassGenerator.Execute(); var marshaller = new DeleteResourcePolicyRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("DeleteResourcePolicy", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("InvalidRequestException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InvalidRequestException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = DeleteResourcePolicyResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("XRay")] public void DeleteResourcePolicy_ThrottledExceptionMarshallTest() { var operation = service_model.FindOperation("DeleteResourcePolicy"); var request = InstantiateClassGenerator.Execute(); var marshaller = new DeleteResourcePolicyRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("DeleteResourcePolicy", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ThrottledException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ThrottledException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = DeleteResourcePolicyResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("XRay")] public void DeleteSamplingRuleMarshallTest() { var operation = service_model.FindOperation("DeleteSamplingRule"); var request = InstantiateClassGenerator.Execute(); var marshaller = new DeleteSamplingRuleRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("DeleteSamplingRule", request, internalRequest, service_model); var webResponse = new WebResponseData { Headers = { {"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 = DeleteSamplingRuleResponseUnmarshaller.Instance; var response = unmarshaller.Unmarshall(context) as DeleteSamplingRuleResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("XRay")] public void DeleteSamplingRule_InvalidRequestExceptionMarshallTest() { var operation = service_model.FindOperation("DeleteSamplingRule"); var request = InstantiateClassGenerator.Execute(); var marshaller = new DeleteSamplingRuleRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("DeleteSamplingRule", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("InvalidRequestException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InvalidRequestException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = DeleteSamplingRuleResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("XRay")] public void DeleteSamplingRule_ThrottledExceptionMarshallTest() { var operation = service_model.FindOperation("DeleteSamplingRule"); var request = InstantiateClassGenerator.Execute(); var marshaller = new DeleteSamplingRuleRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("DeleteSamplingRule", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ThrottledException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ThrottledException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = DeleteSamplingRuleResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("XRay")] public void GetEncryptionConfigMarshallTest() { var operation = service_model.FindOperation("GetEncryptionConfig"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetEncryptionConfigRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetEncryptionConfig", request, internalRequest, service_model); var webResponse = new WebResponseData { Headers = { {"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 = GetEncryptionConfigResponseUnmarshaller.Instance; var response = unmarshaller.Unmarshall(context) as GetEncryptionConfigResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("XRay")] public void GetEncryptionConfig_InvalidRequestExceptionMarshallTest() { var operation = service_model.FindOperation("GetEncryptionConfig"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetEncryptionConfigRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetEncryptionConfig", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("InvalidRequestException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InvalidRequestException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetEncryptionConfigResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("XRay")] public void GetEncryptionConfig_ThrottledExceptionMarshallTest() { var operation = service_model.FindOperation("GetEncryptionConfig"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetEncryptionConfigRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetEncryptionConfig", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ThrottledException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ThrottledException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetEncryptionConfigResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("XRay")] public void GetGroupMarshallTest() { var operation = service_model.FindOperation("GetGroup"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetGroupRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetGroup", request, internalRequest, service_model); var webResponse = new WebResponseData { Headers = { {"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 = GetGroupResponseUnmarshaller.Instance; var response = unmarshaller.Unmarshall(context) as GetGroupResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("XRay")] public void GetGroup_InvalidRequestExceptionMarshallTest() { var operation = service_model.FindOperation("GetGroup"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetGroupRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetGroup", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("InvalidRequestException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InvalidRequestException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetGroupResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("XRay")] public void GetGroup_ThrottledExceptionMarshallTest() { var operation = service_model.FindOperation("GetGroup"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetGroupRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetGroup", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ThrottledException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ThrottledException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetGroupResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("XRay")] public void GetGroupsMarshallTest() { var operation = service_model.FindOperation("GetGroups"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetGroupsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetGroups", request, internalRequest, service_model); var webResponse = new WebResponseData { Headers = { {"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 = GetGroupsResponseUnmarshaller.Instance; var response = unmarshaller.Unmarshall(context) as GetGroupsResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("XRay")] public void GetGroups_InvalidRequestExceptionMarshallTest() { var operation = service_model.FindOperation("GetGroups"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetGroupsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetGroups", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("InvalidRequestException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InvalidRequestException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetGroupsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("XRay")] public void GetGroups_ThrottledExceptionMarshallTest() { var operation = service_model.FindOperation("GetGroups"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetGroupsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetGroups", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ThrottledException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ThrottledException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetGroupsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("XRay")] public void GetInsightMarshallTest() { var operation = service_model.FindOperation("GetInsight"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetInsightRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetInsight", request, internalRequest, service_model); var webResponse = new WebResponseData { Headers = { {"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 = GetInsightResponseUnmarshaller.Instance; var response = unmarshaller.Unmarshall(context) as GetInsightResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("XRay")] public void GetInsight_InvalidRequestExceptionMarshallTest() { var operation = service_model.FindOperation("GetInsight"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetInsightRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetInsight", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("InvalidRequestException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InvalidRequestException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetInsightResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("XRay")] public void GetInsight_ThrottledExceptionMarshallTest() { var operation = service_model.FindOperation("GetInsight"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetInsightRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetInsight", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ThrottledException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ThrottledException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetInsightResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("XRay")] public void GetInsightEventsMarshallTest() { var operation = service_model.FindOperation("GetInsightEvents"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetInsightEventsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetInsightEvents", request, internalRequest, service_model); var webResponse = new WebResponseData { Headers = { {"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 = GetInsightEventsResponseUnmarshaller.Instance; var response = unmarshaller.Unmarshall(context) as GetInsightEventsResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("XRay")] public void GetInsightEvents_InvalidRequestExceptionMarshallTest() { var operation = service_model.FindOperation("GetInsightEvents"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetInsightEventsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetInsightEvents", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("InvalidRequestException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InvalidRequestException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetInsightEventsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("XRay")] public void GetInsightEvents_ThrottledExceptionMarshallTest() { var operation = service_model.FindOperation("GetInsightEvents"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetInsightEventsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetInsightEvents", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ThrottledException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ThrottledException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetInsightEventsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("XRay")] public void GetInsightImpactGraphMarshallTest() { var operation = service_model.FindOperation("GetInsightImpactGraph"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetInsightImpactGraphRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetInsightImpactGraph", request, internalRequest, service_model); var webResponse = new WebResponseData { Headers = { {"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 = GetInsightImpactGraphResponseUnmarshaller.Instance; var response = unmarshaller.Unmarshall(context) as GetInsightImpactGraphResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("XRay")] public void GetInsightImpactGraph_InvalidRequestExceptionMarshallTest() { var operation = service_model.FindOperation("GetInsightImpactGraph"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetInsightImpactGraphRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetInsightImpactGraph", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("InvalidRequestException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InvalidRequestException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetInsightImpactGraphResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("XRay")] public void GetInsightImpactGraph_ThrottledExceptionMarshallTest() { var operation = service_model.FindOperation("GetInsightImpactGraph"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetInsightImpactGraphRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetInsightImpactGraph", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ThrottledException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ThrottledException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetInsightImpactGraphResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("XRay")] public void GetInsightSummariesMarshallTest() { var operation = service_model.FindOperation("GetInsightSummaries"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetInsightSummariesRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetInsightSummaries", request, internalRequest, service_model); var webResponse = new WebResponseData { Headers = { {"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 = GetInsightSummariesResponseUnmarshaller.Instance; var response = unmarshaller.Unmarshall(context) as GetInsightSummariesResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("XRay")] public void GetInsightSummaries_InvalidRequestExceptionMarshallTest() { var operation = service_model.FindOperation("GetInsightSummaries"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetInsightSummariesRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetInsightSummaries", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("InvalidRequestException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InvalidRequestException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetInsightSummariesResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("XRay")] public void GetInsightSummaries_ThrottledExceptionMarshallTest() { var operation = service_model.FindOperation("GetInsightSummaries"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetInsightSummariesRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetInsightSummaries", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ThrottledException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ThrottledException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetInsightSummariesResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("XRay")] public void GetSamplingRulesMarshallTest() { var operation = service_model.FindOperation("GetSamplingRules"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetSamplingRulesRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetSamplingRules", request, internalRequest, service_model); var webResponse = new WebResponseData { Headers = { {"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 = GetSamplingRulesResponseUnmarshaller.Instance; var response = unmarshaller.Unmarshall(context) as GetSamplingRulesResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("XRay")] public void GetSamplingRules_InvalidRequestExceptionMarshallTest() { var operation = service_model.FindOperation("GetSamplingRules"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetSamplingRulesRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetSamplingRules", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("InvalidRequestException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InvalidRequestException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetSamplingRulesResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("XRay")] public void GetSamplingRules_ThrottledExceptionMarshallTest() { var operation = service_model.FindOperation("GetSamplingRules"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetSamplingRulesRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetSamplingRules", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ThrottledException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ThrottledException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetSamplingRulesResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("XRay")] public void GetSamplingStatisticSummariesMarshallTest() { var operation = service_model.FindOperation("GetSamplingStatisticSummaries"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetSamplingStatisticSummariesRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetSamplingStatisticSummaries", request, internalRequest, service_model); var webResponse = new WebResponseData { Headers = { {"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 = GetSamplingStatisticSummariesResponseUnmarshaller.Instance; var response = unmarshaller.Unmarshall(context) as GetSamplingStatisticSummariesResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("XRay")] public void GetSamplingStatisticSummaries_InvalidRequestExceptionMarshallTest() { var operation = service_model.FindOperation("GetSamplingStatisticSummaries"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetSamplingStatisticSummariesRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetSamplingStatisticSummaries", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("InvalidRequestException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InvalidRequestException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetSamplingStatisticSummariesResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("XRay")] public void GetSamplingStatisticSummaries_ThrottledExceptionMarshallTest() { var operation = service_model.FindOperation("GetSamplingStatisticSummaries"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetSamplingStatisticSummariesRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetSamplingStatisticSummaries", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ThrottledException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ThrottledException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetSamplingStatisticSummariesResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("XRay")] public void GetSamplingTargetsMarshallTest() { var operation = service_model.FindOperation("GetSamplingTargets"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetSamplingTargetsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetSamplingTargets", request, internalRequest, service_model); var webResponse = new WebResponseData { Headers = { {"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 = GetSamplingTargetsResponseUnmarshaller.Instance; var response = unmarshaller.Unmarshall(context) as GetSamplingTargetsResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("XRay")] public void GetSamplingTargets_InvalidRequestExceptionMarshallTest() { var operation = service_model.FindOperation("GetSamplingTargets"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetSamplingTargetsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetSamplingTargets", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("InvalidRequestException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InvalidRequestException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetSamplingTargetsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("XRay")] public void GetSamplingTargets_ThrottledExceptionMarshallTest() { var operation = service_model.FindOperation("GetSamplingTargets"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetSamplingTargetsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetSamplingTargets", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ThrottledException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ThrottledException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetSamplingTargetsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("XRay")] public void GetServiceGraphMarshallTest() { var operation = service_model.FindOperation("GetServiceGraph"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetServiceGraphRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetServiceGraph", request, internalRequest, service_model); var webResponse = new WebResponseData { Headers = { {"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 = GetServiceGraphResponseUnmarshaller.Instance; var response = unmarshaller.Unmarshall(context) as GetServiceGraphResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("XRay")] public void GetServiceGraph_InvalidRequestExceptionMarshallTest() { var operation = service_model.FindOperation("GetServiceGraph"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetServiceGraphRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetServiceGraph", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("InvalidRequestException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InvalidRequestException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetServiceGraphResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("XRay")] public void GetServiceGraph_ThrottledExceptionMarshallTest() { var operation = service_model.FindOperation("GetServiceGraph"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetServiceGraphRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetServiceGraph", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ThrottledException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ThrottledException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetServiceGraphResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("XRay")] public void GetTimeSeriesServiceStatisticsMarshallTest() { var operation = service_model.FindOperation("GetTimeSeriesServiceStatistics"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetTimeSeriesServiceStatisticsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetTimeSeriesServiceStatistics", request, internalRequest, service_model); var webResponse = new WebResponseData { Headers = { {"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 = GetTimeSeriesServiceStatisticsResponseUnmarshaller.Instance; var response = unmarshaller.Unmarshall(context) as GetTimeSeriesServiceStatisticsResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("XRay")] public void GetTimeSeriesServiceStatistics_InvalidRequestExceptionMarshallTest() { var operation = service_model.FindOperation("GetTimeSeriesServiceStatistics"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetTimeSeriesServiceStatisticsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetTimeSeriesServiceStatistics", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("InvalidRequestException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InvalidRequestException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetTimeSeriesServiceStatisticsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("XRay")] public void GetTimeSeriesServiceStatistics_ThrottledExceptionMarshallTest() { var operation = service_model.FindOperation("GetTimeSeriesServiceStatistics"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetTimeSeriesServiceStatisticsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetTimeSeriesServiceStatistics", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ThrottledException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ThrottledException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetTimeSeriesServiceStatisticsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("XRay")] public void GetTraceGraphMarshallTest() { var operation = service_model.FindOperation("GetTraceGraph"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetTraceGraphRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetTraceGraph", request, internalRequest, service_model); var webResponse = new WebResponseData { Headers = { {"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 = GetTraceGraphResponseUnmarshaller.Instance; var response = unmarshaller.Unmarshall(context) as GetTraceGraphResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("XRay")] public void GetTraceGraph_InvalidRequestExceptionMarshallTest() { var operation = service_model.FindOperation("GetTraceGraph"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetTraceGraphRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetTraceGraph", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("InvalidRequestException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InvalidRequestException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetTraceGraphResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("XRay")] public void GetTraceGraph_ThrottledExceptionMarshallTest() { var operation = service_model.FindOperation("GetTraceGraph"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetTraceGraphRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetTraceGraph", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ThrottledException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ThrottledException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetTraceGraphResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("XRay")] public void GetTraceSummariesMarshallTest() { var operation = service_model.FindOperation("GetTraceSummaries"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetTraceSummariesRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetTraceSummaries", request, internalRequest, service_model); var webResponse = new WebResponseData { Headers = { {"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 = GetTraceSummariesResponseUnmarshaller.Instance; var response = unmarshaller.Unmarshall(context) as GetTraceSummariesResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("XRay")] public void GetTraceSummaries_InvalidRequestExceptionMarshallTest() { var operation = service_model.FindOperation("GetTraceSummaries"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetTraceSummariesRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetTraceSummaries", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("InvalidRequestException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InvalidRequestException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetTraceSummariesResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("XRay")] public void GetTraceSummaries_ThrottledExceptionMarshallTest() { var operation = service_model.FindOperation("GetTraceSummaries"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetTraceSummariesRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetTraceSummaries", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ThrottledException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ThrottledException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetTraceSummariesResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("XRay")] public void ListResourcePoliciesMarshallTest() { var operation = service_model.FindOperation("ListResourcePolicies"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListResourcePoliciesRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("ListResourcePolicies", request, internalRequest, service_model); var webResponse = new WebResponseData { Headers = { {"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 = ListResourcePoliciesResponseUnmarshaller.Instance; var response = unmarshaller.Unmarshall(context) as ListResourcePoliciesResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("XRay")] public void ListResourcePolicies_InvalidRequestExceptionMarshallTest() { var operation = service_model.FindOperation("ListResourcePolicies"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListResourcePoliciesRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("ListResourcePolicies", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("InvalidRequestException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InvalidRequestException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = ListResourcePoliciesResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("XRay")] public void ListResourcePolicies_ThrottledExceptionMarshallTest() { var operation = service_model.FindOperation("ListResourcePolicies"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListResourcePoliciesRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("ListResourcePolicies", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ThrottledException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ThrottledException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = ListResourcePoliciesResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("XRay")] public void ListTagsForResourceMarshallTest() { var operation = service_model.FindOperation("ListTagsForResource"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListTagsForResourceRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("ListTagsForResource", request, internalRequest, service_model); var webResponse = new WebResponseData { Headers = { {"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 = ListTagsForResourceResponseUnmarshaller.Instance; var response = unmarshaller.Unmarshall(context) as ListTagsForResourceResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("XRay")] public void ListTagsForResource_InvalidRequestExceptionMarshallTest() { var operation = service_model.FindOperation("ListTagsForResource"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListTagsForResourceRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("ListTagsForResource", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("InvalidRequestException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InvalidRequestException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = ListTagsForResourceResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("XRay")] public void ListTagsForResource_ResourceNotFoundExceptionMarshallTest() { var operation = service_model.FindOperation("ListTagsForResource"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListTagsForResourceRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("ListTagsForResource", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ResourceNotFoundException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ResourceNotFoundException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = ListTagsForResourceResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("XRay")] public void ListTagsForResource_ThrottledExceptionMarshallTest() { var operation = service_model.FindOperation("ListTagsForResource"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListTagsForResourceRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("ListTagsForResource", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ThrottledException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ThrottledException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = ListTagsForResourceResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("XRay")] public void PutEncryptionConfigMarshallTest() { var operation = service_model.FindOperation("PutEncryptionConfig"); var request = InstantiateClassGenerator.Execute(); var marshaller = new PutEncryptionConfigRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("PutEncryptionConfig", request, internalRequest, service_model); var webResponse = new WebResponseData { Headers = { {"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 = PutEncryptionConfigResponseUnmarshaller.Instance; var response = unmarshaller.Unmarshall(context) as PutEncryptionConfigResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("XRay")] public void PutEncryptionConfig_InvalidRequestExceptionMarshallTest() { var operation = service_model.FindOperation("PutEncryptionConfig"); var request = InstantiateClassGenerator.Execute(); var marshaller = new PutEncryptionConfigRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("PutEncryptionConfig", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("InvalidRequestException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InvalidRequestException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = PutEncryptionConfigResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("XRay")] public void PutEncryptionConfig_ThrottledExceptionMarshallTest() { var operation = service_model.FindOperation("PutEncryptionConfig"); var request = InstantiateClassGenerator.Execute(); var marshaller = new PutEncryptionConfigRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("PutEncryptionConfig", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ThrottledException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ThrottledException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = PutEncryptionConfigResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("XRay")] public void PutResourcePolicyMarshallTest() { var operation = service_model.FindOperation("PutResourcePolicy"); var request = InstantiateClassGenerator.Execute(); var marshaller = new PutResourcePolicyRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("PutResourcePolicy", request, internalRequest, service_model); var webResponse = new WebResponseData { Headers = { {"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 = PutResourcePolicyResponseUnmarshaller.Instance; var response = unmarshaller.Unmarshall(context) as PutResourcePolicyResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("XRay")] public void PutResourcePolicy_InvalidPolicyRevisionIdExceptionMarshallTest() { var operation = service_model.FindOperation("PutResourcePolicy"); var request = InstantiateClassGenerator.Execute(); var marshaller = new PutResourcePolicyRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("PutResourcePolicy", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("InvalidPolicyRevisionIdException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InvalidPolicyRevisionIdException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = PutResourcePolicyResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("XRay")] public void PutResourcePolicy_LockoutPreventionExceptionMarshallTest() { var operation = service_model.FindOperation("PutResourcePolicy"); var request = InstantiateClassGenerator.Execute(); var marshaller = new PutResourcePolicyRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("PutResourcePolicy", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("LockoutPreventionException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","LockoutPreventionException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = PutResourcePolicyResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("XRay")] public void PutResourcePolicy_MalformedPolicyDocumentExceptionMarshallTest() { var operation = service_model.FindOperation("PutResourcePolicy"); var request = InstantiateClassGenerator.Execute(); var marshaller = new PutResourcePolicyRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("PutResourcePolicy", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("MalformedPolicyDocumentException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","MalformedPolicyDocumentException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = PutResourcePolicyResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("XRay")] public void PutResourcePolicy_PolicyCountLimitExceededExceptionMarshallTest() { var operation = service_model.FindOperation("PutResourcePolicy"); var request = InstantiateClassGenerator.Execute(); var marshaller = new PutResourcePolicyRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("PutResourcePolicy", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("PolicyCountLimitExceededException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","PolicyCountLimitExceededException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = PutResourcePolicyResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("XRay")] public void PutResourcePolicy_PolicySizeLimitExceededExceptionMarshallTest() { var operation = service_model.FindOperation("PutResourcePolicy"); var request = InstantiateClassGenerator.Execute(); var marshaller = new PutResourcePolicyRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("PutResourcePolicy", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("PolicySizeLimitExceededException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","PolicySizeLimitExceededException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = PutResourcePolicyResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("XRay")] public void PutResourcePolicy_ThrottledExceptionMarshallTest() { var operation = service_model.FindOperation("PutResourcePolicy"); var request = InstantiateClassGenerator.Execute(); var marshaller = new PutResourcePolicyRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("PutResourcePolicy", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ThrottledException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ThrottledException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = PutResourcePolicyResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("XRay")] public void PutTelemetryRecordsMarshallTest() { var operation = service_model.FindOperation("PutTelemetryRecords"); var request = InstantiateClassGenerator.Execute(); var marshaller = new PutTelemetryRecordsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("PutTelemetryRecords", request, internalRequest, service_model); var webResponse = new WebResponseData { Headers = { {"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 = PutTelemetryRecordsResponseUnmarshaller.Instance; var response = unmarshaller.Unmarshall(context) as PutTelemetryRecordsResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("XRay")] public void PutTelemetryRecords_InvalidRequestExceptionMarshallTest() { var operation = service_model.FindOperation("PutTelemetryRecords"); var request = InstantiateClassGenerator.Execute(); var marshaller = new PutTelemetryRecordsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("PutTelemetryRecords", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("InvalidRequestException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InvalidRequestException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = PutTelemetryRecordsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("XRay")] public void PutTelemetryRecords_ThrottledExceptionMarshallTest() { var operation = service_model.FindOperation("PutTelemetryRecords"); var request = InstantiateClassGenerator.Execute(); var marshaller = new PutTelemetryRecordsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("PutTelemetryRecords", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ThrottledException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ThrottledException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = PutTelemetryRecordsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("XRay")] public void PutTraceSegmentsMarshallTest() { var operation = service_model.FindOperation("PutTraceSegments"); var request = InstantiateClassGenerator.Execute(); var marshaller = new PutTraceSegmentsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("PutTraceSegments", request, internalRequest, service_model); var webResponse = new WebResponseData { Headers = { {"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 = PutTraceSegmentsResponseUnmarshaller.Instance; var response = unmarshaller.Unmarshall(context) as PutTraceSegmentsResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("XRay")] public void PutTraceSegments_InvalidRequestExceptionMarshallTest() { var operation = service_model.FindOperation("PutTraceSegments"); var request = InstantiateClassGenerator.Execute(); var marshaller = new PutTraceSegmentsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("PutTraceSegments", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("InvalidRequestException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InvalidRequestException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = PutTraceSegmentsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("XRay")] public void PutTraceSegments_ThrottledExceptionMarshallTest() { var operation = service_model.FindOperation("PutTraceSegments"); var request = InstantiateClassGenerator.Execute(); var marshaller = new PutTraceSegmentsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("PutTraceSegments", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ThrottledException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ThrottledException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = PutTraceSegmentsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("XRay")] public void TagResourceMarshallTest() { var operation = service_model.FindOperation("TagResource"); var request = InstantiateClassGenerator.Execute(); var marshaller = new TagResourceRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("TagResource", request, internalRequest, service_model); var webResponse = new WebResponseData { Headers = { {"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 = TagResourceResponseUnmarshaller.Instance; var response = unmarshaller.Unmarshall(context) as TagResourceResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("XRay")] public void TagResource_InvalidRequestExceptionMarshallTest() { var operation = service_model.FindOperation("TagResource"); var request = InstantiateClassGenerator.Execute(); var marshaller = new TagResourceRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("TagResource", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("InvalidRequestException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InvalidRequestException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = TagResourceResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("XRay")] public void TagResource_ResourceNotFoundExceptionMarshallTest() { var operation = service_model.FindOperation("TagResource"); var request = InstantiateClassGenerator.Execute(); var marshaller = new TagResourceRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("TagResource", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ResourceNotFoundException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ResourceNotFoundException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = TagResourceResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("XRay")] public void TagResource_ThrottledExceptionMarshallTest() { var operation = service_model.FindOperation("TagResource"); var request = InstantiateClassGenerator.Execute(); var marshaller = new TagResourceRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("TagResource", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ThrottledException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ThrottledException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = TagResourceResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("XRay")] public void TagResource_TooManyTagsExceptionMarshallTest() { var operation = service_model.FindOperation("TagResource"); var request = InstantiateClassGenerator.Execute(); var marshaller = new TagResourceRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("TagResource", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("TooManyTagsException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","TooManyTagsException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = TagResourceResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("XRay")] public void UntagResourceMarshallTest() { var operation = service_model.FindOperation("UntagResource"); var request = InstantiateClassGenerator.Execute(); var marshaller = new UntagResourceRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("UntagResource", request, internalRequest, service_model); var webResponse = new WebResponseData { Headers = { {"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 = UntagResourceResponseUnmarshaller.Instance; var response = unmarshaller.Unmarshall(context) as UntagResourceResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("XRay")] public void UntagResource_InvalidRequestExceptionMarshallTest() { var operation = service_model.FindOperation("UntagResource"); var request = InstantiateClassGenerator.Execute(); var marshaller = new UntagResourceRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("UntagResource", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("InvalidRequestException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InvalidRequestException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = UntagResourceResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("XRay")] public void UntagResource_ResourceNotFoundExceptionMarshallTest() { var operation = service_model.FindOperation("UntagResource"); var request = InstantiateClassGenerator.Execute(); var marshaller = new UntagResourceRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("UntagResource", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ResourceNotFoundException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ResourceNotFoundException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = UntagResourceResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("XRay")] public void UntagResource_ThrottledExceptionMarshallTest() { var operation = service_model.FindOperation("UntagResource"); var request = InstantiateClassGenerator.Execute(); var marshaller = new UntagResourceRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("UntagResource", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ThrottledException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ThrottledException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = UntagResourceResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("XRay")] public void UpdateGroupMarshallTest() { var operation = service_model.FindOperation("UpdateGroup"); var request = InstantiateClassGenerator.Execute(); var marshaller = new UpdateGroupRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("UpdateGroup", request, internalRequest, service_model); var webResponse = new WebResponseData { Headers = { {"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 = UpdateGroupResponseUnmarshaller.Instance; var response = unmarshaller.Unmarshall(context) as UpdateGroupResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("XRay")] public void UpdateGroup_InvalidRequestExceptionMarshallTest() { var operation = service_model.FindOperation("UpdateGroup"); var request = InstantiateClassGenerator.Execute(); var marshaller = new UpdateGroupRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("UpdateGroup", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("InvalidRequestException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InvalidRequestException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = UpdateGroupResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("XRay")] public void UpdateGroup_ThrottledExceptionMarshallTest() { var operation = service_model.FindOperation("UpdateGroup"); var request = InstantiateClassGenerator.Execute(); var marshaller = new UpdateGroupRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("UpdateGroup", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ThrottledException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ThrottledException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = UpdateGroupResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("XRay")] public void UpdateSamplingRuleMarshallTest() { var operation = service_model.FindOperation("UpdateSamplingRule"); var request = InstantiateClassGenerator.Execute(); var marshaller = new UpdateSamplingRuleRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("UpdateSamplingRule", request, internalRequest, service_model); var webResponse = new WebResponseData { Headers = { {"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 = UpdateSamplingRuleResponseUnmarshaller.Instance; var response = unmarshaller.Unmarshall(context) as UpdateSamplingRuleResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("XRay")] public void UpdateSamplingRule_InvalidRequestExceptionMarshallTest() { var operation = service_model.FindOperation("UpdateSamplingRule"); var request = InstantiateClassGenerator.Execute(); var marshaller = new UpdateSamplingRuleRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("UpdateSamplingRule", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("InvalidRequestException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InvalidRequestException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = UpdateSamplingRuleResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("XRay")] public void UpdateSamplingRule_ThrottledExceptionMarshallTest() { var operation = service_model.FindOperation("UpdateSamplingRule"); var request = InstantiateClassGenerator.Execute(); var marshaller = new UpdateSamplingRuleRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("UpdateSamplingRule", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ThrottledException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ThrottledException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = UpdateSamplingRuleResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } } }