/* * 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 inspector-2016-02-16.normal.json service model. */ using System; using System.IO; using System.Linq; using System.Text; using Microsoft.VisualStudio.TestTools.UnitTesting; using Amazon.Inspector; using Amazon.Inspector.Model; using Amazon.Inspector.Model.Internal.MarshallTransformations; using Amazon.Runtime.Internal.Transform; using ServiceClientGenerator; using AWSSDK_DotNet35.UnitTests.TestTools; namespace AWSSDK_DotNet35.UnitTests.Marshalling { [TestClass] public class InspectorMarshallingTests { static readonly ServiceModel service_model = Utils.LoadServiceModel("inspector"); [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void AddAttributesToFindingsMarshallTest() { var request = InstantiateClassGenerator.Execute(); var marshaller = new AddAttributesToFindingsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"} } }; var jsonResponse = new JsonSampleGenerator(service_model, service_model.FindOperation("AddAttributesToFindings").ResponseStructure).Execute(); webResponse.Headers.Add("Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()); UnmarshallerContext context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), false, webResponse); var response = AddAttributesToFindingsResponseUnmarshaller.Instance.Unmarshall(context) as AddAttributesToFindingsResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void AddAttributesToFindings_AccessDeniedExceptionMarshallTest() { var operation = service_model.FindOperation("AddAttributesToFindings"); var request = InstantiateClassGenerator.Execute(); var marshaller = new AddAttributesToFindingsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var exception = operation.Exceptions.First(e => e.Name.Equals("AccessDeniedException")); var jsonResponse = new JsonSampleGenerator(service_model, exception).Execute(); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","AccessDeniedException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = AddAttributesToFindingsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void AddAttributesToFindings_InternalExceptionMarshallTest() { var operation = service_model.FindOperation("AddAttributesToFindings"); var request = InstantiateClassGenerator.Execute(); var marshaller = new AddAttributesToFindingsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var exception = operation.Exceptions.First(e => e.Name.Equals("InternalException")); var jsonResponse = new JsonSampleGenerator(service_model, exception).Execute(); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InternalException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = AddAttributesToFindingsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void AddAttributesToFindings_InvalidInputExceptionMarshallTest() { var operation = service_model.FindOperation("AddAttributesToFindings"); var request = InstantiateClassGenerator.Execute(); var marshaller = new AddAttributesToFindingsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var exception = operation.Exceptions.First(e => e.Name.Equals("InvalidInputException")); var jsonResponse = new JsonSampleGenerator(service_model, exception).Execute(); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InvalidInputException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = AddAttributesToFindingsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void AddAttributesToFindings_NoSuchEntityExceptionMarshallTest() { var operation = service_model.FindOperation("AddAttributesToFindings"); var request = InstantiateClassGenerator.Execute(); var marshaller = new AddAttributesToFindingsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var exception = operation.Exceptions.First(e => e.Name.Equals("NoSuchEntityException")); var jsonResponse = new JsonSampleGenerator(service_model, exception).Execute(); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","NoSuchEntityException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = AddAttributesToFindingsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void AddAttributesToFindings_ServiceTemporarilyUnavailableExceptionMarshallTest() { var operation = service_model.FindOperation("AddAttributesToFindings"); var request = InstantiateClassGenerator.Execute(); var marshaller = new AddAttributesToFindingsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var exception = operation.Exceptions.First(e => e.Name.Equals("ServiceTemporarilyUnavailableException")); var jsonResponse = new JsonSampleGenerator(service_model, exception).Execute(); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ServiceTemporarilyUnavailableException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = AddAttributesToFindingsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void CreateAssessmentTargetMarshallTest() { var request = InstantiateClassGenerator.Execute(); var marshaller = new CreateAssessmentTargetRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"} } }; var jsonResponse = new JsonSampleGenerator(service_model, service_model.FindOperation("CreateAssessmentTarget").ResponseStructure).Execute(); webResponse.Headers.Add("Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()); UnmarshallerContext context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), false, webResponse); var response = CreateAssessmentTargetResponseUnmarshaller.Instance.Unmarshall(context) as CreateAssessmentTargetResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void CreateAssessmentTarget_AccessDeniedExceptionMarshallTest() { var operation = service_model.FindOperation("CreateAssessmentTarget"); var request = InstantiateClassGenerator.Execute(); var marshaller = new CreateAssessmentTargetRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var exception = operation.Exceptions.First(e => e.Name.Equals("AccessDeniedException")); var jsonResponse = new JsonSampleGenerator(service_model, exception).Execute(); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","AccessDeniedException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = CreateAssessmentTargetResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void CreateAssessmentTarget_InternalExceptionMarshallTest() { var operation = service_model.FindOperation("CreateAssessmentTarget"); var request = InstantiateClassGenerator.Execute(); var marshaller = new CreateAssessmentTargetRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var exception = operation.Exceptions.First(e => e.Name.Equals("InternalException")); var jsonResponse = new JsonSampleGenerator(service_model, exception).Execute(); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InternalException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = CreateAssessmentTargetResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void CreateAssessmentTarget_InvalidCrossAccountRoleExceptionMarshallTest() { var operation = service_model.FindOperation("CreateAssessmentTarget"); var request = InstantiateClassGenerator.Execute(); var marshaller = new CreateAssessmentTargetRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var exception = operation.Exceptions.First(e => e.Name.Equals("InvalidCrossAccountRoleException")); var jsonResponse = new JsonSampleGenerator(service_model, exception).Execute(); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InvalidCrossAccountRoleException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = CreateAssessmentTargetResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void CreateAssessmentTarget_InvalidInputExceptionMarshallTest() { var operation = service_model.FindOperation("CreateAssessmentTarget"); var request = InstantiateClassGenerator.Execute(); var marshaller = new CreateAssessmentTargetRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var exception = operation.Exceptions.First(e => e.Name.Equals("InvalidInputException")); var jsonResponse = new JsonSampleGenerator(service_model, exception).Execute(); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InvalidInputException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = CreateAssessmentTargetResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void CreateAssessmentTarget_LimitExceededExceptionMarshallTest() { var operation = service_model.FindOperation("CreateAssessmentTarget"); var request = InstantiateClassGenerator.Execute(); var marshaller = new CreateAssessmentTargetRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var exception = operation.Exceptions.First(e => e.Name.Equals("LimitExceededException")); var jsonResponse = new JsonSampleGenerator(service_model, exception).Execute(); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","LimitExceededException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = CreateAssessmentTargetResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void CreateAssessmentTarget_NoSuchEntityExceptionMarshallTest() { var operation = service_model.FindOperation("CreateAssessmentTarget"); var request = InstantiateClassGenerator.Execute(); var marshaller = new CreateAssessmentTargetRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var exception = operation.Exceptions.First(e => e.Name.Equals("NoSuchEntityException")); var jsonResponse = new JsonSampleGenerator(service_model, exception).Execute(); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","NoSuchEntityException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = CreateAssessmentTargetResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void CreateAssessmentTarget_ServiceTemporarilyUnavailableExceptionMarshallTest() { var operation = service_model.FindOperation("CreateAssessmentTarget"); var request = InstantiateClassGenerator.Execute(); var marshaller = new CreateAssessmentTargetRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var exception = operation.Exceptions.First(e => e.Name.Equals("ServiceTemporarilyUnavailableException")); var jsonResponse = new JsonSampleGenerator(service_model, exception).Execute(); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ServiceTemporarilyUnavailableException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = CreateAssessmentTargetResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void CreateAssessmentTemplateMarshallTest() { var request = InstantiateClassGenerator.Execute(); var marshaller = new CreateAssessmentTemplateRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"} } }; var jsonResponse = new JsonSampleGenerator(service_model, service_model.FindOperation("CreateAssessmentTemplate").ResponseStructure).Execute(); webResponse.Headers.Add("Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()); UnmarshallerContext context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), false, webResponse); var response = CreateAssessmentTemplateResponseUnmarshaller.Instance.Unmarshall(context) as CreateAssessmentTemplateResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void CreateAssessmentTemplate_AccessDeniedExceptionMarshallTest() { var operation = service_model.FindOperation("CreateAssessmentTemplate"); var request = InstantiateClassGenerator.Execute(); var marshaller = new CreateAssessmentTemplateRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var exception = operation.Exceptions.First(e => e.Name.Equals("AccessDeniedException")); var jsonResponse = new JsonSampleGenerator(service_model, exception).Execute(); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","AccessDeniedException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = CreateAssessmentTemplateResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void CreateAssessmentTemplate_InternalExceptionMarshallTest() { var operation = service_model.FindOperation("CreateAssessmentTemplate"); var request = InstantiateClassGenerator.Execute(); var marshaller = new CreateAssessmentTemplateRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var exception = operation.Exceptions.First(e => e.Name.Equals("InternalException")); var jsonResponse = new JsonSampleGenerator(service_model, exception).Execute(); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InternalException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = CreateAssessmentTemplateResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void CreateAssessmentTemplate_InvalidInputExceptionMarshallTest() { var operation = service_model.FindOperation("CreateAssessmentTemplate"); var request = InstantiateClassGenerator.Execute(); var marshaller = new CreateAssessmentTemplateRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var exception = operation.Exceptions.First(e => e.Name.Equals("InvalidInputException")); var jsonResponse = new JsonSampleGenerator(service_model, exception).Execute(); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InvalidInputException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = CreateAssessmentTemplateResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void CreateAssessmentTemplate_LimitExceededExceptionMarshallTest() { var operation = service_model.FindOperation("CreateAssessmentTemplate"); var request = InstantiateClassGenerator.Execute(); var marshaller = new CreateAssessmentTemplateRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var exception = operation.Exceptions.First(e => e.Name.Equals("LimitExceededException")); var jsonResponse = new JsonSampleGenerator(service_model, exception).Execute(); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","LimitExceededException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = CreateAssessmentTemplateResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void CreateAssessmentTemplate_NoSuchEntityExceptionMarshallTest() { var operation = service_model.FindOperation("CreateAssessmentTemplate"); var request = InstantiateClassGenerator.Execute(); var marshaller = new CreateAssessmentTemplateRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var exception = operation.Exceptions.First(e => e.Name.Equals("NoSuchEntityException")); var jsonResponse = new JsonSampleGenerator(service_model, exception).Execute(); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","NoSuchEntityException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = CreateAssessmentTemplateResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void CreateAssessmentTemplate_ServiceTemporarilyUnavailableExceptionMarshallTest() { var operation = service_model.FindOperation("CreateAssessmentTemplate"); var request = InstantiateClassGenerator.Execute(); var marshaller = new CreateAssessmentTemplateRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var exception = operation.Exceptions.First(e => e.Name.Equals("ServiceTemporarilyUnavailableException")); var jsonResponse = new JsonSampleGenerator(service_model, exception).Execute(); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ServiceTemporarilyUnavailableException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = CreateAssessmentTemplateResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void CreateExclusionsPreviewMarshallTest() { var request = InstantiateClassGenerator.Execute(); var marshaller = new CreateExclusionsPreviewRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"} } }; var jsonResponse = new JsonSampleGenerator(service_model, service_model.FindOperation("CreateExclusionsPreview").ResponseStructure).Execute(); webResponse.Headers.Add("Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()); UnmarshallerContext context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), false, webResponse); var response = CreateExclusionsPreviewResponseUnmarshaller.Instance.Unmarshall(context) as CreateExclusionsPreviewResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void CreateExclusionsPreview_AccessDeniedExceptionMarshallTest() { var operation = service_model.FindOperation("CreateExclusionsPreview"); var request = InstantiateClassGenerator.Execute(); var marshaller = new CreateExclusionsPreviewRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var exception = operation.Exceptions.First(e => e.Name.Equals("AccessDeniedException")); var jsonResponse = new JsonSampleGenerator(service_model, exception).Execute(); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","AccessDeniedException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = CreateExclusionsPreviewResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void CreateExclusionsPreview_InternalExceptionMarshallTest() { var operation = service_model.FindOperation("CreateExclusionsPreview"); var request = InstantiateClassGenerator.Execute(); var marshaller = new CreateExclusionsPreviewRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var exception = operation.Exceptions.First(e => e.Name.Equals("InternalException")); var jsonResponse = new JsonSampleGenerator(service_model, exception).Execute(); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InternalException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = CreateExclusionsPreviewResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void CreateExclusionsPreview_InvalidInputExceptionMarshallTest() { var operation = service_model.FindOperation("CreateExclusionsPreview"); var request = InstantiateClassGenerator.Execute(); var marshaller = new CreateExclusionsPreviewRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var exception = operation.Exceptions.First(e => e.Name.Equals("InvalidInputException")); var jsonResponse = new JsonSampleGenerator(service_model, exception).Execute(); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InvalidInputException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = CreateExclusionsPreviewResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void CreateExclusionsPreview_NoSuchEntityExceptionMarshallTest() { var operation = service_model.FindOperation("CreateExclusionsPreview"); var request = InstantiateClassGenerator.Execute(); var marshaller = new CreateExclusionsPreviewRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var exception = operation.Exceptions.First(e => e.Name.Equals("NoSuchEntityException")); var jsonResponse = new JsonSampleGenerator(service_model, exception).Execute(); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","NoSuchEntityException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = CreateExclusionsPreviewResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void CreateExclusionsPreview_PreviewGenerationInProgressExceptionMarshallTest() { var operation = service_model.FindOperation("CreateExclusionsPreview"); var request = InstantiateClassGenerator.Execute(); var marshaller = new CreateExclusionsPreviewRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var exception = operation.Exceptions.First(e => e.Name.Equals("PreviewGenerationInProgressException")); var jsonResponse = new JsonSampleGenerator(service_model, exception).Execute(); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","PreviewGenerationInProgressException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = CreateExclusionsPreviewResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void CreateExclusionsPreview_ServiceTemporarilyUnavailableExceptionMarshallTest() { var operation = service_model.FindOperation("CreateExclusionsPreview"); var request = InstantiateClassGenerator.Execute(); var marshaller = new CreateExclusionsPreviewRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var exception = operation.Exceptions.First(e => e.Name.Equals("ServiceTemporarilyUnavailableException")); var jsonResponse = new JsonSampleGenerator(service_model, exception).Execute(); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ServiceTemporarilyUnavailableException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = CreateExclusionsPreviewResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void CreateResourceGroupMarshallTest() { var request = InstantiateClassGenerator.Execute(); var marshaller = new CreateResourceGroupRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"} } }; var jsonResponse = new JsonSampleGenerator(service_model, service_model.FindOperation("CreateResourceGroup").ResponseStructure).Execute(); webResponse.Headers.Add("Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()); UnmarshallerContext context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), false, webResponse); var response = CreateResourceGroupResponseUnmarshaller.Instance.Unmarshall(context) as CreateResourceGroupResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void CreateResourceGroup_AccessDeniedExceptionMarshallTest() { var operation = service_model.FindOperation("CreateResourceGroup"); var request = InstantiateClassGenerator.Execute(); var marshaller = new CreateResourceGroupRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var exception = operation.Exceptions.First(e => e.Name.Equals("AccessDeniedException")); var jsonResponse = new JsonSampleGenerator(service_model, exception).Execute(); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","AccessDeniedException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = CreateResourceGroupResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void CreateResourceGroup_InternalExceptionMarshallTest() { var operation = service_model.FindOperation("CreateResourceGroup"); var request = InstantiateClassGenerator.Execute(); var marshaller = new CreateResourceGroupRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var exception = operation.Exceptions.First(e => e.Name.Equals("InternalException")); var jsonResponse = new JsonSampleGenerator(service_model, exception).Execute(); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InternalException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = CreateResourceGroupResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void CreateResourceGroup_InvalidInputExceptionMarshallTest() { var operation = service_model.FindOperation("CreateResourceGroup"); var request = InstantiateClassGenerator.Execute(); var marshaller = new CreateResourceGroupRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var exception = operation.Exceptions.First(e => e.Name.Equals("InvalidInputException")); var jsonResponse = new JsonSampleGenerator(service_model, exception).Execute(); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InvalidInputException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = CreateResourceGroupResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void CreateResourceGroup_LimitExceededExceptionMarshallTest() { var operation = service_model.FindOperation("CreateResourceGroup"); var request = InstantiateClassGenerator.Execute(); var marshaller = new CreateResourceGroupRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var exception = operation.Exceptions.First(e => e.Name.Equals("LimitExceededException")); var jsonResponse = new JsonSampleGenerator(service_model, exception).Execute(); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","LimitExceededException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = CreateResourceGroupResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void CreateResourceGroup_ServiceTemporarilyUnavailableExceptionMarshallTest() { var operation = service_model.FindOperation("CreateResourceGroup"); var request = InstantiateClassGenerator.Execute(); var marshaller = new CreateResourceGroupRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var exception = operation.Exceptions.First(e => e.Name.Equals("ServiceTemporarilyUnavailableException")); var jsonResponse = new JsonSampleGenerator(service_model, exception).Execute(); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ServiceTemporarilyUnavailableException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = CreateResourceGroupResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void DeleteAssessmentRunMarshallTest() { var request = InstantiateClassGenerator.Execute(); var marshaller = new DeleteAssessmentRunRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void DeleteAssessmentRun_AccessDeniedExceptionMarshallTest() { var operation = service_model.FindOperation("DeleteAssessmentRun"); var request = InstantiateClassGenerator.Execute(); var marshaller = new DeleteAssessmentRunRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var exception = operation.Exceptions.First(e => e.Name.Equals("AccessDeniedException")); var jsonResponse = new JsonSampleGenerator(service_model, exception).Execute(); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","AccessDeniedException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = DeleteAssessmentRunResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void DeleteAssessmentRun_AssessmentRunInProgressExceptionMarshallTest() { var operation = service_model.FindOperation("DeleteAssessmentRun"); var request = InstantiateClassGenerator.Execute(); var marshaller = new DeleteAssessmentRunRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var exception = operation.Exceptions.First(e => e.Name.Equals("AssessmentRunInProgressException")); var jsonResponse = new JsonSampleGenerator(service_model, exception).Execute(); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","AssessmentRunInProgressException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = DeleteAssessmentRunResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void DeleteAssessmentRun_InternalExceptionMarshallTest() { var operation = service_model.FindOperation("DeleteAssessmentRun"); var request = InstantiateClassGenerator.Execute(); var marshaller = new DeleteAssessmentRunRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var exception = operation.Exceptions.First(e => e.Name.Equals("InternalException")); var jsonResponse = new JsonSampleGenerator(service_model, exception).Execute(); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InternalException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = DeleteAssessmentRunResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void DeleteAssessmentRun_InvalidInputExceptionMarshallTest() { var operation = service_model.FindOperation("DeleteAssessmentRun"); var request = InstantiateClassGenerator.Execute(); var marshaller = new DeleteAssessmentRunRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var exception = operation.Exceptions.First(e => e.Name.Equals("InvalidInputException")); var jsonResponse = new JsonSampleGenerator(service_model, exception).Execute(); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InvalidInputException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = DeleteAssessmentRunResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void DeleteAssessmentRun_NoSuchEntityExceptionMarshallTest() { var operation = service_model.FindOperation("DeleteAssessmentRun"); var request = InstantiateClassGenerator.Execute(); var marshaller = new DeleteAssessmentRunRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var exception = operation.Exceptions.First(e => e.Name.Equals("NoSuchEntityException")); var jsonResponse = new JsonSampleGenerator(service_model, exception).Execute(); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","NoSuchEntityException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = DeleteAssessmentRunResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void DeleteAssessmentRun_ServiceTemporarilyUnavailableExceptionMarshallTest() { var operation = service_model.FindOperation("DeleteAssessmentRun"); var request = InstantiateClassGenerator.Execute(); var marshaller = new DeleteAssessmentRunRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var exception = operation.Exceptions.First(e => e.Name.Equals("ServiceTemporarilyUnavailableException")); var jsonResponse = new JsonSampleGenerator(service_model, exception).Execute(); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ServiceTemporarilyUnavailableException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = DeleteAssessmentRunResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void DeleteAssessmentTargetMarshallTest() { var request = InstantiateClassGenerator.Execute(); var marshaller = new DeleteAssessmentTargetRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void DeleteAssessmentTarget_AccessDeniedExceptionMarshallTest() { var operation = service_model.FindOperation("DeleteAssessmentTarget"); var request = InstantiateClassGenerator.Execute(); var marshaller = new DeleteAssessmentTargetRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var exception = operation.Exceptions.First(e => e.Name.Equals("AccessDeniedException")); var jsonResponse = new JsonSampleGenerator(service_model, exception).Execute(); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","AccessDeniedException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = DeleteAssessmentTargetResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void DeleteAssessmentTarget_AssessmentRunInProgressExceptionMarshallTest() { var operation = service_model.FindOperation("DeleteAssessmentTarget"); var request = InstantiateClassGenerator.Execute(); var marshaller = new DeleteAssessmentTargetRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var exception = operation.Exceptions.First(e => e.Name.Equals("AssessmentRunInProgressException")); var jsonResponse = new JsonSampleGenerator(service_model, exception).Execute(); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","AssessmentRunInProgressException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = DeleteAssessmentTargetResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void DeleteAssessmentTarget_InternalExceptionMarshallTest() { var operation = service_model.FindOperation("DeleteAssessmentTarget"); var request = InstantiateClassGenerator.Execute(); var marshaller = new DeleteAssessmentTargetRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var exception = operation.Exceptions.First(e => e.Name.Equals("InternalException")); var jsonResponse = new JsonSampleGenerator(service_model, exception).Execute(); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InternalException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = DeleteAssessmentTargetResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void DeleteAssessmentTarget_InvalidInputExceptionMarshallTest() { var operation = service_model.FindOperation("DeleteAssessmentTarget"); var request = InstantiateClassGenerator.Execute(); var marshaller = new DeleteAssessmentTargetRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var exception = operation.Exceptions.First(e => e.Name.Equals("InvalidInputException")); var jsonResponse = new JsonSampleGenerator(service_model, exception).Execute(); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InvalidInputException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = DeleteAssessmentTargetResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void DeleteAssessmentTarget_NoSuchEntityExceptionMarshallTest() { var operation = service_model.FindOperation("DeleteAssessmentTarget"); var request = InstantiateClassGenerator.Execute(); var marshaller = new DeleteAssessmentTargetRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var exception = operation.Exceptions.First(e => e.Name.Equals("NoSuchEntityException")); var jsonResponse = new JsonSampleGenerator(service_model, exception).Execute(); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","NoSuchEntityException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = DeleteAssessmentTargetResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void DeleteAssessmentTarget_ServiceTemporarilyUnavailableExceptionMarshallTest() { var operation = service_model.FindOperation("DeleteAssessmentTarget"); var request = InstantiateClassGenerator.Execute(); var marshaller = new DeleteAssessmentTargetRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var exception = operation.Exceptions.First(e => e.Name.Equals("ServiceTemporarilyUnavailableException")); var jsonResponse = new JsonSampleGenerator(service_model, exception).Execute(); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ServiceTemporarilyUnavailableException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = DeleteAssessmentTargetResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void DeleteAssessmentTemplateMarshallTest() { var request = InstantiateClassGenerator.Execute(); var marshaller = new DeleteAssessmentTemplateRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void DeleteAssessmentTemplate_AccessDeniedExceptionMarshallTest() { var operation = service_model.FindOperation("DeleteAssessmentTemplate"); var request = InstantiateClassGenerator.Execute(); var marshaller = new DeleteAssessmentTemplateRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var exception = operation.Exceptions.First(e => e.Name.Equals("AccessDeniedException")); var jsonResponse = new JsonSampleGenerator(service_model, exception).Execute(); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","AccessDeniedException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = DeleteAssessmentTemplateResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void DeleteAssessmentTemplate_AssessmentRunInProgressExceptionMarshallTest() { var operation = service_model.FindOperation("DeleteAssessmentTemplate"); var request = InstantiateClassGenerator.Execute(); var marshaller = new DeleteAssessmentTemplateRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var exception = operation.Exceptions.First(e => e.Name.Equals("AssessmentRunInProgressException")); var jsonResponse = new JsonSampleGenerator(service_model, exception).Execute(); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","AssessmentRunInProgressException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = DeleteAssessmentTemplateResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void DeleteAssessmentTemplate_InternalExceptionMarshallTest() { var operation = service_model.FindOperation("DeleteAssessmentTemplate"); var request = InstantiateClassGenerator.Execute(); var marshaller = new DeleteAssessmentTemplateRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var exception = operation.Exceptions.First(e => e.Name.Equals("InternalException")); var jsonResponse = new JsonSampleGenerator(service_model, exception).Execute(); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InternalException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = DeleteAssessmentTemplateResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void DeleteAssessmentTemplate_InvalidInputExceptionMarshallTest() { var operation = service_model.FindOperation("DeleteAssessmentTemplate"); var request = InstantiateClassGenerator.Execute(); var marshaller = new DeleteAssessmentTemplateRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var exception = operation.Exceptions.First(e => e.Name.Equals("InvalidInputException")); var jsonResponse = new JsonSampleGenerator(service_model, exception).Execute(); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InvalidInputException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = DeleteAssessmentTemplateResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void DeleteAssessmentTemplate_NoSuchEntityExceptionMarshallTest() { var operation = service_model.FindOperation("DeleteAssessmentTemplate"); var request = InstantiateClassGenerator.Execute(); var marshaller = new DeleteAssessmentTemplateRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var exception = operation.Exceptions.First(e => e.Name.Equals("NoSuchEntityException")); var jsonResponse = new JsonSampleGenerator(service_model, exception).Execute(); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","NoSuchEntityException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = DeleteAssessmentTemplateResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void DeleteAssessmentTemplate_ServiceTemporarilyUnavailableExceptionMarshallTest() { var operation = service_model.FindOperation("DeleteAssessmentTemplate"); var request = InstantiateClassGenerator.Execute(); var marshaller = new DeleteAssessmentTemplateRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var exception = operation.Exceptions.First(e => e.Name.Equals("ServiceTemporarilyUnavailableException")); var jsonResponse = new JsonSampleGenerator(service_model, exception).Execute(); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ServiceTemporarilyUnavailableException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = DeleteAssessmentTemplateResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void DescribeAssessmentRunsMarshallTest() { var request = InstantiateClassGenerator.Execute(); var marshaller = new DescribeAssessmentRunsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"} } }; var jsonResponse = new JsonSampleGenerator(service_model, service_model.FindOperation("DescribeAssessmentRuns").ResponseStructure).Execute(); webResponse.Headers.Add("Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()); UnmarshallerContext context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), false, webResponse); var response = DescribeAssessmentRunsResponseUnmarshaller.Instance.Unmarshall(context) as DescribeAssessmentRunsResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void DescribeAssessmentRuns_InternalExceptionMarshallTest() { var operation = service_model.FindOperation("DescribeAssessmentRuns"); var request = InstantiateClassGenerator.Execute(); var marshaller = new DescribeAssessmentRunsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var exception = operation.Exceptions.First(e => e.Name.Equals("InternalException")); var jsonResponse = new JsonSampleGenerator(service_model, exception).Execute(); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InternalException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = DescribeAssessmentRunsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void DescribeAssessmentRuns_InvalidInputExceptionMarshallTest() { var operation = service_model.FindOperation("DescribeAssessmentRuns"); var request = InstantiateClassGenerator.Execute(); var marshaller = new DescribeAssessmentRunsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var exception = operation.Exceptions.First(e => e.Name.Equals("InvalidInputException")); var jsonResponse = new JsonSampleGenerator(service_model, exception).Execute(); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InvalidInputException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = DescribeAssessmentRunsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void DescribeAssessmentTargetsMarshallTest() { var request = InstantiateClassGenerator.Execute(); var marshaller = new DescribeAssessmentTargetsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"} } }; var jsonResponse = new JsonSampleGenerator(service_model, service_model.FindOperation("DescribeAssessmentTargets").ResponseStructure).Execute(); webResponse.Headers.Add("Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()); UnmarshallerContext context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), false, webResponse); var response = DescribeAssessmentTargetsResponseUnmarshaller.Instance.Unmarshall(context) as DescribeAssessmentTargetsResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void DescribeAssessmentTargets_InternalExceptionMarshallTest() { var operation = service_model.FindOperation("DescribeAssessmentTargets"); var request = InstantiateClassGenerator.Execute(); var marshaller = new DescribeAssessmentTargetsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var exception = operation.Exceptions.First(e => e.Name.Equals("InternalException")); var jsonResponse = new JsonSampleGenerator(service_model, exception).Execute(); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InternalException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = DescribeAssessmentTargetsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void DescribeAssessmentTargets_InvalidInputExceptionMarshallTest() { var operation = service_model.FindOperation("DescribeAssessmentTargets"); var request = InstantiateClassGenerator.Execute(); var marshaller = new DescribeAssessmentTargetsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var exception = operation.Exceptions.First(e => e.Name.Equals("InvalidInputException")); var jsonResponse = new JsonSampleGenerator(service_model, exception).Execute(); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InvalidInputException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = DescribeAssessmentTargetsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void DescribeAssessmentTemplatesMarshallTest() { var request = InstantiateClassGenerator.Execute(); var marshaller = new DescribeAssessmentTemplatesRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"} } }; var jsonResponse = new JsonSampleGenerator(service_model, service_model.FindOperation("DescribeAssessmentTemplates").ResponseStructure).Execute(); webResponse.Headers.Add("Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()); UnmarshallerContext context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), false, webResponse); var response = DescribeAssessmentTemplatesResponseUnmarshaller.Instance.Unmarshall(context) as DescribeAssessmentTemplatesResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void DescribeAssessmentTemplates_InternalExceptionMarshallTest() { var operation = service_model.FindOperation("DescribeAssessmentTemplates"); var request = InstantiateClassGenerator.Execute(); var marshaller = new DescribeAssessmentTemplatesRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var exception = operation.Exceptions.First(e => e.Name.Equals("InternalException")); var jsonResponse = new JsonSampleGenerator(service_model, exception).Execute(); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InternalException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = DescribeAssessmentTemplatesResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void DescribeAssessmentTemplates_InvalidInputExceptionMarshallTest() { var operation = service_model.FindOperation("DescribeAssessmentTemplates"); var request = InstantiateClassGenerator.Execute(); var marshaller = new DescribeAssessmentTemplatesRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var exception = operation.Exceptions.First(e => e.Name.Equals("InvalidInputException")); var jsonResponse = new JsonSampleGenerator(service_model, exception).Execute(); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InvalidInputException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = DescribeAssessmentTemplatesResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void DescribeCrossAccountAccessRoleMarshallTest() { var request = InstantiateClassGenerator.Execute(); var marshaller = new DescribeCrossAccountAccessRoleRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"} } }; var jsonResponse = new JsonSampleGenerator(service_model, service_model.FindOperation("DescribeCrossAccountAccessRole").ResponseStructure).Execute(); webResponse.Headers.Add("Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()); UnmarshallerContext context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), false, webResponse); var response = DescribeCrossAccountAccessRoleResponseUnmarshaller.Instance.Unmarshall(context) as DescribeCrossAccountAccessRoleResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void DescribeCrossAccountAccessRole_InternalExceptionMarshallTest() { var operation = service_model.FindOperation("DescribeCrossAccountAccessRole"); var request = InstantiateClassGenerator.Execute(); var marshaller = new DescribeCrossAccountAccessRoleRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var exception = operation.Exceptions.First(e => e.Name.Equals("InternalException")); var jsonResponse = new JsonSampleGenerator(service_model, exception).Execute(); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InternalException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = DescribeCrossAccountAccessRoleResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void DescribeExclusionsMarshallTest() { var request = InstantiateClassGenerator.Execute(); var marshaller = new DescribeExclusionsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"} } }; var jsonResponse = new JsonSampleGenerator(service_model, service_model.FindOperation("DescribeExclusions").ResponseStructure).Execute(); webResponse.Headers.Add("Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()); UnmarshallerContext context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), false, webResponse); var response = DescribeExclusionsResponseUnmarshaller.Instance.Unmarshall(context) as DescribeExclusionsResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void DescribeExclusions_InternalExceptionMarshallTest() { var operation = service_model.FindOperation("DescribeExclusions"); var request = InstantiateClassGenerator.Execute(); var marshaller = new DescribeExclusionsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var exception = operation.Exceptions.First(e => e.Name.Equals("InternalException")); var jsonResponse = new JsonSampleGenerator(service_model, exception).Execute(); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InternalException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = DescribeExclusionsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void DescribeExclusions_InvalidInputExceptionMarshallTest() { var operation = service_model.FindOperation("DescribeExclusions"); var request = InstantiateClassGenerator.Execute(); var marshaller = new DescribeExclusionsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var exception = operation.Exceptions.First(e => e.Name.Equals("InvalidInputException")); var jsonResponse = new JsonSampleGenerator(service_model, exception).Execute(); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InvalidInputException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = DescribeExclusionsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void DescribeFindingsMarshallTest() { var request = InstantiateClassGenerator.Execute(); var marshaller = new DescribeFindingsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"} } }; var jsonResponse = new JsonSampleGenerator(service_model, service_model.FindOperation("DescribeFindings").ResponseStructure).Execute(); webResponse.Headers.Add("Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()); UnmarshallerContext context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), false, webResponse); var response = DescribeFindingsResponseUnmarshaller.Instance.Unmarshall(context) as DescribeFindingsResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void DescribeFindings_InternalExceptionMarshallTest() { var operation = service_model.FindOperation("DescribeFindings"); var request = InstantiateClassGenerator.Execute(); var marshaller = new DescribeFindingsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var exception = operation.Exceptions.First(e => e.Name.Equals("InternalException")); var jsonResponse = new JsonSampleGenerator(service_model, exception).Execute(); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InternalException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = DescribeFindingsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void DescribeFindings_InvalidInputExceptionMarshallTest() { var operation = service_model.FindOperation("DescribeFindings"); var request = InstantiateClassGenerator.Execute(); var marshaller = new DescribeFindingsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var exception = operation.Exceptions.First(e => e.Name.Equals("InvalidInputException")); var jsonResponse = new JsonSampleGenerator(service_model, exception).Execute(); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InvalidInputException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = DescribeFindingsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void DescribeResourceGroupsMarshallTest() { var request = InstantiateClassGenerator.Execute(); var marshaller = new DescribeResourceGroupsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"} } }; var jsonResponse = new JsonSampleGenerator(service_model, service_model.FindOperation("DescribeResourceGroups").ResponseStructure).Execute(); webResponse.Headers.Add("Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()); UnmarshallerContext context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), false, webResponse); var response = DescribeResourceGroupsResponseUnmarshaller.Instance.Unmarshall(context) as DescribeResourceGroupsResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void DescribeResourceGroups_InternalExceptionMarshallTest() { var operation = service_model.FindOperation("DescribeResourceGroups"); var request = InstantiateClassGenerator.Execute(); var marshaller = new DescribeResourceGroupsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var exception = operation.Exceptions.First(e => e.Name.Equals("InternalException")); var jsonResponse = new JsonSampleGenerator(service_model, exception).Execute(); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InternalException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = DescribeResourceGroupsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void DescribeResourceGroups_InvalidInputExceptionMarshallTest() { var operation = service_model.FindOperation("DescribeResourceGroups"); var request = InstantiateClassGenerator.Execute(); var marshaller = new DescribeResourceGroupsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var exception = operation.Exceptions.First(e => e.Name.Equals("InvalidInputException")); var jsonResponse = new JsonSampleGenerator(service_model, exception).Execute(); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InvalidInputException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = DescribeResourceGroupsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void DescribeRulesPackagesMarshallTest() { var request = InstantiateClassGenerator.Execute(); var marshaller = new DescribeRulesPackagesRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"} } }; var jsonResponse = new JsonSampleGenerator(service_model, service_model.FindOperation("DescribeRulesPackages").ResponseStructure).Execute(); webResponse.Headers.Add("Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()); UnmarshallerContext context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), false, webResponse); var response = DescribeRulesPackagesResponseUnmarshaller.Instance.Unmarshall(context) as DescribeRulesPackagesResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void DescribeRulesPackages_InternalExceptionMarshallTest() { var operation = service_model.FindOperation("DescribeRulesPackages"); var request = InstantiateClassGenerator.Execute(); var marshaller = new DescribeRulesPackagesRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var exception = operation.Exceptions.First(e => e.Name.Equals("InternalException")); var jsonResponse = new JsonSampleGenerator(service_model, exception).Execute(); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InternalException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = DescribeRulesPackagesResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void DescribeRulesPackages_InvalidInputExceptionMarshallTest() { var operation = service_model.FindOperation("DescribeRulesPackages"); var request = InstantiateClassGenerator.Execute(); var marshaller = new DescribeRulesPackagesRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var exception = operation.Exceptions.First(e => e.Name.Equals("InvalidInputException")); var jsonResponse = new JsonSampleGenerator(service_model, exception).Execute(); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InvalidInputException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = DescribeRulesPackagesResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void GetAssessmentReportMarshallTest() { var request = InstantiateClassGenerator.Execute(); var marshaller = new GetAssessmentReportRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"} } }; var jsonResponse = new JsonSampleGenerator(service_model, service_model.FindOperation("GetAssessmentReport").ResponseStructure).Execute(); webResponse.Headers.Add("Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()); UnmarshallerContext context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), false, webResponse); var response = GetAssessmentReportResponseUnmarshaller.Instance.Unmarshall(context) as GetAssessmentReportResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void GetAssessmentReport_AccessDeniedExceptionMarshallTest() { var operation = service_model.FindOperation("GetAssessmentReport"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetAssessmentReportRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var exception = operation.Exceptions.First(e => e.Name.Equals("AccessDeniedException")); var jsonResponse = new JsonSampleGenerator(service_model, exception).Execute(); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","AccessDeniedException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = GetAssessmentReportResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void GetAssessmentReport_AssessmentRunInProgressExceptionMarshallTest() { var operation = service_model.FindOperation("GetAssessmentReport"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetAssessmentReportRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var exception = operation.Exceptions.First(e => e.Name.Equals("AssessmentRunInProgressException")); var jsonResponse = new JsonSampleGenerator(service_model, exception).Execute(); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","AssessmentRunInProgressException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = GetAssessmentReportResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void GetAssessmentReport_InternalExceptionMarshallTest() { var operation = service_model.FindOperation("GetAssessmentReport"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetAssessmentReportRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var exception = operation.Exceptions.First(e => e.Name.Equals("InternalException")); var jsonResponse = new JsonSampleGenerator(service_model, exception).Execute(); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InternalException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = GetAssessmentReportResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void GetAssessmentReport_InvalidInputExceptionMarshallTest() { var operation = service_model.FindOperation("GetAssessmentReport"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetAssessmentReportRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var exception = operation.Exceptions.First(e => e.Name.Equals("InvalidInputException")); var jsonResponse = new JsonSampleGenerator(service_model, exception).Execute(); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InvalidInputException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = GetAssessmentReportResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void GetAssessmentReport_NoSuchEntityExceptionMarshallTest() { var operation = service_model.FindOperation("GetAssessmentReport"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetAssessmentReportRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var exception = operation.Exceptions.First(e => e.Name.Equals("NoSuchEntityException")); var jsonResponse = new JsonSampleGenerator(service_model, exception).Execute(); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","NoSuchEntityException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = GetAssessmentReportResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void GetAssessmentReport_ServiceTemporarilyUnavailableExceptionMarshallTest() { var operation = service_model.FindOperation("GetAssessmentReport"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetAssessmentReportRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var exception = operation.Exceptions.First(e => e.Name.Equals("ServiceTemporarilyUnavailableException")); var jsonResponse = new JsonSampleGenerator(service_model, exception).Execute(); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ServiceTemporarilyUnavailableException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = GetAssessmentReportResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void GetAssessmentReport_UnsupportedFeatureExceptionMarshallTest() { var operation = service_model.FindOperation("GetAssessmentReport"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetAssessmentReportRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var exception = operation.Exceptions.First(e => e.Name.Equals("UnsupportedFeatureException")); var jsonResponse = new JsonSampleGenerator(service_model, exception).Execute(); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","UnsupportedFeatureException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = GetAssessmentReportResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void GetExclusionsPreviewMarshallTest() { var request = InstantiateClassGenerator.Execute(); var marshaller = new GetExclusionsPreviewRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"} } }; var jsonResponse = new JsonSampleGenerator(service_model, service_model.FindOperation("GetExclusionsPreview").ResponseStructure).Execute(); webResponse.Headers.Add("Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()); UnmarshallerContext context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), false, webResponse); var response = GetExclusionsPreviewResponseUnmarshaller.Instance.Unmarshall(context) as GetExclusionsPreviewResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void GetExclusionsPreview_AccessDeniedExceptionMarshallTest() { var operation = service_model.FindOperation("GetExclusionsPreview"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetExclusionsPreviewRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var exception = operation.Exceptions.First(e => e.Name.Equals("AccessDeniedException")); var jsonResponse = new JsonSampleGenerator(service_model, exception).Execute(); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","AccessDeniedException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = GetExclusionsPreviewResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void GetExclusionsPreview_InternalExceptionMarshallTest() { var operation = service_model.FindOperation("GetExclusionsPreview"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetExclusionsPreviewRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var exception = operation.Exceptions.First(e => e.Name.Equals("InternalException")); var jsonResponse = new JsonSampleGenerator(service_model, exception).Execute(); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InternalException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = GetExclusionsPreviewResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void GetExclusionsPreview_InvalidInputExceptionMarshallTest() { var operation = service_model.FindOperation("GetExclusionsPreview"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetExclusionsPreviewRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var exception = operation.Exceptions.First(e => e.Name.Equals("InvalidInputException")); var jsonResponse = new JsonSampleGenerator(service_model, exception).Execute(); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InvalidInputException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = GetExclusionsPreviewResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void GetExclusionsPreview_NoSuchEntityExceptionMarshallTest() { var operation = service_model.FindOperation("GetExclusionsPreview"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetExclusionsPreviewRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var exception = operation.Exceptions.First(e => e.Name.Equals("NoSuchEntityException")); var jsonResponse = new JsonSampleGenerator(service_model, exception).Execute(); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","NoSuchEntityException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = GetExclusionsPreviewResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void GetTelemetryMetadataMarshallTest() { var request = InstantiateClassGenerator.Execute(); var marshaller = new GetTelemetryMetadataRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"} } }; var jsonResponse = new JsonSampleGenerator(service_model, service_model.FindOperation("GetTelemetryMetadata").ResponseStructure).Execute(); webResponse.Headers.Add("Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()); UnmarshallerContext context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), false, webResponse); var response = GetTelemetryMetadataResponseUnmarshaller.Instance.Unmarshall(context) as GetTelemetryMetadataResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void GetTelemetryMetadata_AccessDeniedExceptionMarshallTest() { var operation = service_model.FindOperation("GetTelemetryMetadata"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetTelemetryMetadataRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var exception = operation.Exceptions.First(e => e.Name.Equals("AccessDeniedException")); var jsonResponse = new JsonSampleGenerator(service_model, exception).Execute(); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","AccessDeniedException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = GetTelemetryMetadataResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void GetTelemetryMetadata_InternalExceptionMarshallTest() { var operation = service_model.FindOperation("GetTelemetryMetadata"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetTelemetryMetadataRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var exception = operation.Exceptions.First(e => e.Name.Equals("InternalException")); var jsonResponse = new JsonSampleGenerator(service_model, exception).Execute(); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InternalException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = GetTelemetryMetadataResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void GetTelemetryMetadata_InvalidInputExceptionMarshallTest() { var operation = service_model.FindOperation("GetTelemetryMetadata"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetTelemetryMetadataRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var exception = operation.Exceptions.First(e => e.Name.Equals("InvalidInputException")); var jsonResponse = new JsonSampleGenerator(service_model, exception).Execute(); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InvalidInputException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = GetTelemetryMetadataResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void GetTelemetryMetadata_NoSuchEntityExceptionMarshallTest() { var operation = service_model.FindOperation("GetTelemetryMetadata"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetTelemetryMetadataRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var exception = operation.Exceptions.First(e => e.Name.Equals("NoSuchEntityException")); var jsonResponse = new JsonSampleGenerator(service_model, exception).Execute(); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","NoSuchEntityException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = GetTelemetryMetadataResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void ListAssessmentRunAgentsMarshallTest() { var request = InstantiateClassGenerator.Execute(); var marshaller = new ListAssessmentRunAgentsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"} } }; var jsonResponse = new JsonSampleGenerator(service_model, service_model.FindOperation("ListAssessmentRunAgents").ResponseStructure).Execute(); webResponse.Headers.Add("Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()); UnmarshallerContext context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), false, webResponse); var response = ListAssessmentRunAgentsResponseUnmarshaller.Instance.Unmarshall(context) as ListAssessmentRunAgentsResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void ListAssessmentRunAgents_AccessDeniedExceptionMarshallTest() { var operation = service_model.FindOperation("ListAssessmentRunAgents"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListAssessmentRunAgentsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var exception = operation.Exceptions.First(e => e.Name.Equals("AccessDeniedException")); var jsonResponse = new JsonSampleGenerator(service_model, exception).Execute(); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","AccessDeniedException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = ListAssessmentRunAgentsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void ListAssessmentRunAgents_InternalExceptionMarshallTest() { var operation = service_model.FindOperation("ListAssessmentRunAgents"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListAssessmentRunAgentsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var exception = operation.Exceptions.First(e => e.Name.Equals("InternalException")); var jsonResponse = new JsonSampleGenerator(service_model, exception).Execute(); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InternalException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = ListAssessmentRunAgentsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void ListAssessmentRunAgents_InvalidInputExceptionMarshallTest() { var operation = service_model.FindOperation("ListAssessmentRunAgents"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListAssessmentRunAgentsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var exception = operation.Exceptions.First(e => e.Name.Equals("InvalidInputException")); var jsonResponse = new JsonSampleGenerator(service_model, exception).Execute(); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InvalidInputException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = ListAssessmentRunAgentsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void ListAssessmentRunAgents_NoSuchEntityExceptionMarshallTest() { var operation = service_model.FindOperation("ListAssessmentRunAgents"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListAssessmentRunAgentsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var exception = operation.Exceptions.First(e => e.Name.Equals("NoSuchEntityException")); var jsonResponse = new JsonSampleGenerator(service_model, exception).Execute(); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","NoSuchEntityException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = ListAssessmentRunAgentsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void ListAssessmentRunsMarshallTest() { var request = InstantiateClassGenerator.Execute(); var marshaller = new ListAssessmentRunsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"} } }; var jsonResponse = new JsonSampleGenerator(service_model, service_model.FindOperation("ListAssessmentRuns").ResponseStructure).Execute(); webResponse.Headers.Add("Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()); UnmarshallerContext context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), false, webResponse); var response = ListAssessmentRunsResponseUnmarshaller.Instance.Unmarshall(context) as ListAssessmentRunsResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void ListAssessmentRuns_AccessDeniedExceptionMarshallTest() { var operation = service_model.FindOperation("ListAssessmentRuns"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListAssessmentRunsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var exception = operation.Exceptions.First(e => e.Name.Equals("AccessDeniedException")); var jsonResponse = new JsonSampleGenerator(service_model, exception).Execute(); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","AccessDeniedException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = ListAssessmentRunsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void ListAssessmentRuns_InternalExceptionMarshallTest() { var operation = service_model.FindOperation("ListAssessmentRuns"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListAssessmentRunsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var exception = operation.Exceptions.First(e => e.Name.Equals("InternalException")); var jsonResponse = new JsonSampleGenerator(service_model, exception).Execute(); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InternalException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = ListAssessmentRunsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void ListAssessmentRuns_InvalidInputExceptionMarshallTest() { var operation = service_model.FindOperation("ListAssessmentRuns"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListAssessmentRunsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var exception = operation.Exceptions.First(e => e.Name.Equals("InvalidInputException")); var jsonResponse = new JsonSampleGenerator(service_model, exception).Execute(); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InvalidInputException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = ListAssessmentRunsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void ListAssessmentRuns_NoSuchEntityExceptionMarshallTest() { var operation = service_model.FindOperation("ListAssessmentRuns"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListAssessmentRunsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var exception = operation.Exceptions.First(e => e.Name.Equals("NoSuchEntityException")); var jsonResponse = new JsonSampleGenerator(service_model, exception).Execute(); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","NoSuchEntityException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = ListAssessmentRunsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void ListAssessmentTargetsMarshallTest() { var request = InstantiateClassGenerator.Execute(); var marshaller = new ListAssessmentTargetsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"} } }; var jsonResponse = new JsonSampleGenerator(service_model, service_model.FindOperation("ListAssessmentTargets").ResponseStructure).Execute(); webResponse.Headers.Add("Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()); UnmarshallerContext context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), false, webResponse); var response = ListAssessmentTargetsResponseUnmarshaller.Instance.Unmarshall(context) as ListAssessmentTargetsResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void ListAssessmentTargets_AccessDeniedExceptionMarshallTest() { var operation = service_model.FindOperation("ListAssessmentTargets"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListAssessmentTargetsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var exception = operation.Exceptions.First(e => e.Name.Equals("AccessDeniedException")); var jsonResponse = new JsonSampleGenerator(service_model, exception).Execute(); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","AccessDeniedException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = ListAssessmentTargetsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void ListAssessmentTargets_InternalExceptionMarshallTest() { var operation = service_model.FindOperation("ListAssessmentTargets"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListAssessmentTargetsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var exception = operation.Exceptions.First(e => e.Name.Equals("InternalException")); var jsonResponse = new JsonSampleGenerator(service_model, exception).Execute(); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InternalException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = ListAssessmentTargetsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void ListAssessmentTargets_InvalidInputExceptionMarshallTest() { var operation = service_model.FindOperation("ListAssessmentTargets"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListAssessmentTargetsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var exception = operation.Exceptions.First(e => e.Name.Equals("InvalidInputException")); var jsonResponse = new JsonSampleGenerator(service_model, exception).Execute(); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InvalidInputException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = ListAssessmentTargetsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void ListAssessmentTemplatesMarshallTest() { var request = InstantiateClassGenerator.Execute(); var marshaller = new ListAssessmentTemplatesRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"} } }; var jsonResponse = new JsonSampleGenerator(service_model, service_model.FindOperation("ListAssessmentTemplates").ResponseStructure).Execute(); webResponse.Headers.Add("Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()); UnmarshallerContext context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), false, webResponse); var response = ListAssessmentTemplatesResponseUnmarshaller.Instance.Unmarshall(context) as ListAssessmentTemplatesResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void ListAssessmentTemplates_AccessDeniedExceptionMarshallTest() { var operation = service_model.FindOperation("ListAssessmentTemplates"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListAssessmentTemplatesRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var exception = operation.Exceptions.First(e => e.Name.Equals("AccessDeniedException")); var jsonResponse = new JsonSampleGenerator(service_model, exception).Execute(); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","AccessDeniedException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = ListAssessmentTemplatesResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void ListAssessmentTemplates_InternalExceptionMarshallTest() { var operation = service_model.FindOperation("ListAssessmentTemplates"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListAssessmentTemplatesRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var exception = operation.Exceptions.First(e => e.Name.Equals("InternalException")); var jsonResponse = new JsonSampleGenerator(service_model, exception).Execute(); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InternalException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = ListAssessmentTemplatesResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void ListAssessmentTemplates_InvalidInputExceptionMarshallTest() { var operation = service_model.FindOperation("ListAssessmentTemplates"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListAssessmentTemplatesRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var exception = operation.Exceptions.First(e => e.Name.Equals("InvalidInputException")); var jsonResponse = new JsonSampleGenerator(service_model, exception).Execute(); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InvalidInputException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = ListAssessmentTemplatesResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void ListAssessmentTemplates_NoSuchEntityExceptionMarshallTest() { var operation = service_model.FindOperation("ListAssessmentTemplates"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListAssessmentTemplatesRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var exception = operation.Exceptions.First(e => e.Name.Equals("NoSuchEntityException")); var jsonResponse = new JsonSampleGenerator(service_model, exception).Execute(); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","NoSuchEntityException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = ListAssessmentTemplatesResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void ListEventSubscriptionsMarshallTest() { var request = InstantiateClassGenerator.Execute(); var marshaller = new ListEventSubscriptionsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"} } }; var jsonResponse = new JsonSampleGenerator(service_model, service_model.FindOperation("ListEventSubscriptions").ResponseStructure).Execute(); webResponse.Headers.Add("Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()); UnmarshallerContext context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), false, webResponse); var response = ListEventSubscriptionsResponseUnmarshaller.Instance.Unmarshall(context) as ListEventSubscriptionsResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void ListEventSubscriptions_AccessDeniedExceptionMarshallTest() { var operation = service_model.FindOperation("ListEventSubscriptions"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListEventSubscriptionsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var exception = operation.Exceptions.First(e => e.Name.Equals("AccessDeniedException")); var jsonResponse = new JsonSampleGenerator(service_model, exception).Execute(); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","AccessDeniedException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = ListEventSubscriptionsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void ListEventSubscriptions_InternalExceptionMarshallTest() { var operation = service_model.FindOperation("ListEventSubscriptions"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListEventSubscriptionsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var exception = operation.Exceptions.First(e => e.Name.Equals("InternalException")); var jsonResponse = new JsonSampleGenerator(service_model, exception).Execute(); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InternalException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = ListEventSubscriptionsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void ListEventSubscriptions_InvalidInputExceptionMarshallTest() { var operation = service_model.FindOperation("ListEventSubscriptions"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListEventSubscriptionsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var exception = operation.Exceptions.First(e => e.Name.Equals("InvalidInputException")); var jsonResponse = new JsonSampleGenerator(service_model, exception).Execute(); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InvalidInputException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = ListEventSubscriptionsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void ListEventSubscriptions_NoSuchEntityExceptionMarshallTest() { var operation = service_model.FindOperation("ListEventSubscriptions"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListEventSubscriptionsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var exception = operation.Exceptions.First(e => e.Name.Equals("NoSuchEntityException")); var jsonResponse = new JsonSampleGenerator(service_model, exception).Execute(); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","NoSuchEntityException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = ListEventSubscriptionsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void ListExclusionsMarshallTest() { var request = InstantiateClassGenerator.Execute(); var marshaller = new ListExclusionsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"} } }; var jsonResponse = new JsonSampleGenerator(service_model, service_model.FindOperation("ListExclusions").ResponseStructure).Execute(); webResponse.Headers.Add("Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()); UnmarshallerContext context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), false, webResponse); var response = ListExclusionsResponseUnmarshaller.Instance.Unmarshall(context) as ListExclusionsResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void ListExclusions_AccessDeniedExceptionMarshallTest() { var operation = service_model.FindOperation("ListExclusions"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListExclusionsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var exception = operation.Exceptions.First(e => e.Name.Equals("AccessDeniedException")); var jsonResponse = new JsonSampleGenerator(service_model, exception).Execute(); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","AccessDeniedException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = ListExclusionsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void ListExclusions_InternalExceptionMarshallTest() { var operation = service_model.FindOperation("ListExclusions"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListExclusionsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var exception = operation.Exceptions.First(e => e.Name.Equals("InternalException")); var jsonResponse = new JsonSampleGenerator(service_model, exception).Execute(); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InternalException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = ListExclusionsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void ListExclusions_InvalidInputExceptionMarshallTest() { var operation = service_model.FindOperation("ListExclusions"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListExclusionsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var exception = operation.Exceptions.First(e => e.Name.Equals("InvalidInputException")); var jsonResponse = new JsonSampleGenerator(service_model, exception).Execute(); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InvalidInputException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = ListExclusionsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void ListExclusions_NoSuchEntityExceptionMarshallTest() { var operation = service_model.FindOperation("ListExclusions"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListExclusionsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var exception = operation.Exceptions.First(e => e.Name.Equals("NoSuchEntityException")); var jsonResponse = new JsonSampleGenerator(service_model, exception).Execute(); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","NoSuchEntityException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = ListExclusionsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void ListFindingsMarshallTest() { var request = InstantiateClassGenerator.Execute(); var marshaller = new ListFindingsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"} } }; var jsonResponse = new JsonSampleGenerator(service_model, service_model.FindOperation("ListFindings").ResponseStructure).Execute(); webResponse.Headers.Add("Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()); UnmarshallerContext context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), false, webResponse); var response = ListFindingsResponseUnmarshaller.Instance.Unmarshall(context) as ListFindingsResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void ListFindings_AccessDeniedExceptionMarshallTest() { var operation = service_model.FindOperation("ListFindings"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListFindingsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var exception = operation.Exceptions.First(e => e.Name.Equals("AccessDeniedException")); var jsonResponse = new JsonSampleGenerator(service_model, exception).Execute(); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","AccessDeniedException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = ListFindingsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void ListFindings_InternalExceptionMarshallTest() { var operation = service_model.FindOperation("ListFindings"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListFindingsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var exception = operation.Exceptions.First(e => e.Name.Equals("InternalException")); var jsonResponse = new JsonSampleGenerator(service_model, exception).Execute(); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InternalException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = ListFindingsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void ListFindings_InvalidInputExceptionMarshallTest() { var operation = service_model.FindOperation("ListFindings"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListFindingsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var exception = operation.Exceptions.First(e => e.Name.Equals("InvalidInputException")); var jsonResponse = new JsonSampleGenerator(service_model, exception).Execute(); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InvalidInputException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = ListFindingsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void ListFindings_NoSuchEntityExceptionMarshallTest() { var operation = service_model.FindOperation("ListFindings"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListFindingsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var exception = operation.Exceptions.First(e => e.Name.Equals("NoSuchEntityException")); var jsonResponse = new JsonSampleGenerator(service_model, exception).Execute(); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","NoSuchEntityException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = ListFindingsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void ListRulesPackagesMarshallTest() { var request = InstantiateClassGenerator.Execute(); var marshaller = new ListRulesPackagesRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"} } }; var jsonResponse = new JsonSampleGenerator(service_model, service_model.FindOperation("ListRulesPackages").ResponseStructure).Execute(); webResponse.Headers.Add("Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()); UnmarshallerContext context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), false, webResponse); var response = ListRulesPackagesResponseUnmarshaller.Instance.Unmarshall(context) as ListRulesPackagesResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void ListRulesPackages_AccessDeniedExceptionMarshallTest() { var operation = service_model.FindOperation("ListRulesPackages"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListRulesPackagesRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var exception = operation.Exceptions.First(e => e.Name.Equals("AccessDeniedException")); var jsonResponse = new JsonSampleGenerator(service_model, exception).Execute(); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","AccessDeniedException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = ListRulesPackagesResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void ListRulesPackages_InternalExceptionMarshallTest() { var operation = service_model.FindOperation("ListRulesPackages"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListRulesPackagesRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var exception = operation.Exceptions.First(e => e.Name.Equals("InternalException")); var jsonResponse = new JsonSampleGenerator(service_model, exception).Execute(); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InternalException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = ListRulesPackagesResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void ListRulesPackages_InvalidInputExceptionMarshallTest() { var operation = service_model.FindOperation("ListRulesPackages"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListRulesPackagesRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var exception = operation.Exceptions.First(e => e.Name.Equals("InvalidInputException")); var jsonResponse = new JsonSampleGenerator(service_model, exception).Execute(); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InvalidInputException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = ListRulesPackagesResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void ListTagsForResourceMarshallTest() { var request = InstantiateClassGenerator.Execute(); var marshaller = new ListTagsForResourceRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"} } }; var jsonResponse = new JsonSampleGenerator(service_model, service_model.FindOperation("ListTagsForResource").ResponseStructure).Execute(); webResponse.Headers.Add("Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()); UnmarshallerContext context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), false, webResponse); var response = ListTagsForResourceResponseUnmarshaller.Instance.Unmarshall(context) as ListTagsForResourceResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void ListTagsForResource_AccessDeniedExceptionMarshallTest() { var operation = service_model.FindOperation("ListTagsForResource"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListTagsForResourceRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var exception = operation.Exceptions.First(e => e.Name.Equals("AccessDeniedException")); var jsonResponse = new JsonSampleGenerator(service_model, exception).Execute(); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","AccessDeniedException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = ListTagsForResourceResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void ListTagsForResource_InternalExceptionMarshallTest() { var operation = service_model.FindOperation("ListTagsForResource"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListTagsForResourceRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var exception = operation.Exceptions.First(e => e.Name.Equals("InternalException")); var jsonResponse = new JsonSampleGenerator(service_model, exception).Execute(); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InternalException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = ListTagsForResourceResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void ListTagsForResource_InvalidInputExceptionMarshallTest() { var operation = service_model.FindOperation("ListTagsForResource"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListTagsForResourceRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var exception = operation.Exceptions.First(e => e.Name.Equals("InvalidInputException")); var jsonResponse = new JsonSampleGenerator(service_model, exception).Execute(); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InvalidInputException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = ListTagsForResourceResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void ListTagsForResource_NoSuchEntityExceptionMarshallTest() { var operation = service_model.FindOperation("ListTagsForResource"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListTagsForResourceRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var exception = operation.Exceptions.First(e => e.Name.Equals("NoSuchEntityException")); var jsonResponse = new JsonSampleGenerator(service_model, exception).Execute(); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","NoSuchEntityException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = ListTagsForResourceResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void PreviewAgentsMarshallTest() { var request = InstantiateClassGenerator.Execute(); var marshaller = new PreviewAgentsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"} } }; var jsonResponse = new JsonSampleGenerator(service_model, service_model.FindOperation("PreviewAgents").ResponseStructure).Execute(); webResponse.Headers.Add("Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()); UnmarshallerContext context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), false, webResponse); var response = PreviewAgentsResponseUnmarshaller.Instance.Unmarshall(context) as PreviewAgentsResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void PreviewAgents_AccessDeniedExceptionMarshallTest() { var operation = service_model.FindOperation("PreviewAgents"); var request = InstantiateClassGenerator.Execute(); var marshaller = new PreviewAgentsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var exception = operation.Exceptions.First(e => e.Name.Equals("AccessDeniedException")); var jsonResponse = new JsonSampleGenerator(service_model, exception).Execute(); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","AccessDeniedException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = PreviewAgentsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void PreviewAgents_InternalExceptionMarshallTest() { var operation = service_model.FindOperation("PreviewAgents"); var request = InstantiateClassGenerator.Execute(); var marshaller = new PreviewAgentsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var exception = operation.Exceptions.First(e => e.Name.Equals("InternalException")); var jsonResponse = new JsonSampleGenerator(service_model, exception).Execute(); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InternalException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = PreviewAgentsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void PreviewAgents_InvalidCrossAccountRoleExceptionMarshallTest() { var operation = service_model.FindOperation("PreviewAgents"); var request = InstantiateClassGenerator.Execute(); var marshaller = new PreviewAgentsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var exception = operation.Exceptions.First(e => e.Name.Equals("InvalidCrossAccountRoleException")); var jsonResponse = new JsonSampleGenerator(service_model, exception).Execute(); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InvalidCrossAccountRoleException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = PreviewAgentsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void PreviewAgents_InvalidInputExceptionMarshallTest() { var operation = service_model.FindOperation("PreviewAgents"); var request = InstantiateClassGenerator.Execute(); var marshaller = new PreviewAgentsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var exception = operation.Exceptions.First(e => e.Name.Equals("InvalidInputException")); var jsonResponse = new JsonSampleGenerator(service_model, exception).Execute(); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InvalidInputException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = PreviewAgentsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void PreviewAgents_NoSuchEntityExceptionMarshallTest() { var operation = service_model.FindOperation("PreviewAgents"); var request = InstantiateClassGenerator.Execute(); var marshaller = new PreviewAgentsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var exception = operation.Exceptions.First(e => e.Name.Equals("NoSuchEntityException")); var jsonResponse = new JsonSampleGenerator(service_model, exception).Execute(); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","NoSuchEntityException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = PreviewAgentsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void RegisterCrossAccountAccessRoleMarshallTest() { var request = InstantiateClassGenerator.Execute(); var marshaller = new RegisterCrossAccountAccessRoleRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void RegisterCrossAccountAccessRole_AccessDeniedExceptionMarshallTest() { var operation = service_model.FindOperation("RegisterCrossAccountAccessRole"); var request = InstantiateClassGenerator.Execute(); var marshaller = new RegisterCrossAccountAccessRoleRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var exception = operation.Exceptions.First(e => e.Name.Equals("AccessDeniedException")); var jsonResponse = new JsonSampleGenerator(service_model, exception).Execute(); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","AccessDeniedException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = RegisterCrossAccountAccessRoleResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void RegisterCrossAccountAccessRole_InternalExceptionMarshallTest() { var operation = service_model.FindOperation("RegisterCrossAccountAccessRole"); var request = InstantiateClassGenerator.Execute(); var marshaller = new RegisterCrossAccountAccessRoleRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var exception = operation.Exceptions.First(e => e.Name.Equals("InternalException")); var jsonResponse = new JsonSampleGenerator(service_model, exception).Execute(); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InternalException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = RegisterCrossAccountAccessRoleResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void RegisterCrossAccountAccessRole_InvalidCrossAccountRoleExceptionMarshallTest() { var operation = service_model.FindOperation("RegisterCrossAccountAccessRole"); var request = InstantiateClassGenerator.Execute(); var marshaller = new RegisterCrossAccountAccessRoleRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var exception = operation.Exceptions.First(e => e.Name.Equals("InvalidCrossAccountRoleException")); var jsonResponse = new JsonSampleGenerator(service_model, exception).Execute(); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InvalidCrossAccountRoleException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = RegisterCrossAccountAccessRoleResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void RegisterCrossAccountAccessRole_InvalidInputExceptionMarshallTest() { var operation = service_model.FindOperation("RegisterCrossAccountAccessRole"); var request = InstantiateClassGenerator.Execute(); var marshaller = new RegisterCrossAccountAccessRoleRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var exception = operation.Exceptions.First(e => e.Name.Equals("InvalidInputException")); var jsonResponse = new JsonSampleGenerator(service_model, exception).Execute(); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InvalidInputException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = RegisterCrossAccountAccessRoleResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void RegisterCrossAccountAccessRole_ServiceTemporarilyUnavailableExceptionMarshallTest() { var operation = service_model.FindOperation("RegisterCrossAccountAccessRole"); var request = InstantiateClassGenerator.Execute(); var marshaller = new RegisterCrossAccountAccessRoleRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var exception = operation.Exceptions.First(e => e.Name.Equals("ServiceTemporarilyUnavailableException")); var jsonResponse = new JsonSampleGenerator(service_model, exception).Execute(); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ServiceTemporarilyUnavailableException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = RegisterCrossAccountAccessRoleResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void RemoveAttributesFromFindingsMarshallTest() { var request = InstantiateClassGenerator.Execute(); var marshaller = new RemoveAttributesFromFindingsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"} } }; var jsonResponse = new JsonSampleGenerator(service_model, service_model.FindOperation("RemoveAttributesFromFindings").ResponseStructure).Execute(); webResponse.Headers.Add("Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()); UnmarshallerContext context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), false, webResponse); var response = RemoveAttributesFromFindingsResponseUnmarshaller.Instance.Unmarshall(context) as RemoveAttributesFromFindingsResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void RemoveAttributesFromFindings_AccessDeniedExceptionMarshallTest() { var operation = service_model.FindOperation("RemoveAttributesFromFindings"); var request = InstantiateClassGenerator.Execute(); var marshaller = new RemoveAttributesFromFindingsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var exception = operation.Exceptions.First(e => e.Name.Equals("AccessDeniedException")); var jsonResponse = new JsonSampleGenerator(service_model, exception).Execute(); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","AccessDeniedException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = RemoveAttributesFromFindingsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void RemoveAttributesFromFindings_InternalExceptionMarshallTest() { var operation = service_model.FindOperation("RemoveAttributesFromFindings"); var request = InstantiateClassGenerator.Execute(); var marshaller = new RemoveAttributesFromFindingsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var exception = operation.Exceptions.First(e => e.Name.Equals("InternalException")); var jsonResponse = new JsonSampleGenerator(service_model, exception).Execute(); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InternalException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = RemoveAttributesFromFindingsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void RemoveAttributesFromFindings_InvalidInputExceptionMarshallTest() { var operation = service_model.FindOperation("RemoveAttributesFromFindings"); var request = InstantiateClassGenerator.Execute(); var marshaller = new RemoveAttributesFromFindingsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var exception = operation.Exceptions.First(e => e.Name.Equals("InvalidInputException")); var jsonResponse = new JsonSampleGenerator(service_model, exception).Execute(); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InvalidInputException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = RemoveAttributesFromFindingsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void RemoveAttributesFromFindings_NoSuchEntityExceptionMarshallTest() { var operation = service_model.FindOperation("RemoveAttributesFromFindings"); var request = InstantiateClassGenerator.Execute(); var marshaller = new RemoveAttributesFromFindingsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var exception = operation.Exceptions.First(e => e.Name.Equals("NoSuchEntityException")); var jsonResponse = new JsonSampleGenerator(service_model, exception).Execute(); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","NoSuchEntityException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = RemoveAttributesFromFindingsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void RemoveAttributesFromFindings_ServiceTemporarilyUnavailableExceptionMarshallTest() { var operation = service_model.FindOperation("RemoveAttributesFromFindings"); var request = InstantiateClassGenerator.Execute(); var marshaller = new RemoveAttributesFromFindingsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var exception = operation.Exceptions.First(e => e.Name.Equals("ServiceTemporarilyUnavailableException")); var jsonResponse = new JsonSampleGenerator(service_model, exception).Execute(); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ServiceTemporarilyUnavailableException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = RemoveAttributesFromFindingsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void SetTagsForResourceMarshallTest() { var request = InstantiateClassGenerator.Execute(); var marshaller = new SetTagsForResourceRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void SetTagsForResource_AccessDeniedExceptionMarshallTest() { var operation = service_model.FindOperation("SetTagsForResource"); var request = InstantiateClassGenerator.Execute(); var marshaller = new SetTagsForResourceRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var exception = operation.Exceptions.First(e => e.Name.Equals("AccessDeniedException")); var jsonResponse = new JsonSampleGenerator(service_model, exception).Execute(); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","AccessDeniedException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = SetTagsForResourceResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void SetTagsForResource_InternalExceptionMarshallTest() { var operation = service_model.FindOperation("SetTagsForResource"); var request = InstantiateClassGenerator.Execute(); var marshaller = new SetTagsForResourceRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var exception = operation.Exceptions.First(e => e.Name.Equals("InternalException")); var jsonResponse = new JsonSampleGenerator(service_model, exception).Execute(); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InternalException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = SetTagsForResourceResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void SetTagsForResource_InvalidInputExceptionMarshallTest() { var operation = service_model.FindOperation("SetTagsForResource"); var request = InstantiateClassGenerator.Execute(); var marshaller = new SetTagsForResourceRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var exception = operation.Exceptions.First(e => e.Name.Equals("InvalidInputException")); var jsonResponse = new JsonSampleGenerator(service_model, exception).Execute(); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InvalidInputException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = SetTagsForResourceResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void SetTagsForResource_NoSuchEntityExceptionMarshallTest() { var operation = service_model.FindOperation("SetTagsForResource"); var request = InstantiateClassGenerator.Execute(); var marshaller = new SetTagsForResourceRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var exception = operation.Exceptions.First(e => e.Name.Equals("NoSuchEntityException")); var jsonResponse = new JsonSampleGenerator(service_model, exception).Execute(); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","NoSuchEntityException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = SetTagsForResourceResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void SetTagsForResource_ServiceTemporarilyUnavailableExceptionMarshallTest() { var operation = service_model.FindOperation("SetTagsForResource"); var request = InstantiateClassGenerator.Execute(); var marshaller = new SetTagsForResourceRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var exception = operation.Exceptions.First(e => e.Name.Equals("ServiceTemporarilyUnavailableException")); var jsonResponse = new JsonSampleGenerator(service_model, exception).Execute(); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ServiceTemporarilyUnavailableException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = SetTagsForResourceResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void StartAssessmentRunMarshallTest() { var request = InstantiateClassGenerator.Execute(); var marshaller = new StartAssessmentRunRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"} } }; var jsonResponse = new JsonSampleGenerator(service_model, service_model.FindOperation("StartAssessmentRun").ResponseStructure).Execute(); webResponse.Headers.Add("Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()); UnmarshallerContext context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), false, webResponse); var response = StartAssessmentRunResponseUnmarshaller.Instance.Unmarshall(context) as StartAssessmentRunResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void StartAssessmentRun_AccessDeniedExceptionMarshallTest() { var operation = service_model.FindOperation("StartAssessmentRun"); var request = InstantiateClassGenerator.Execute(); var marshaller = new StartAssessmentRunRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var exception = operation.Exceptions.First(e => e.Name.Equals("AccessDeniedException")); var jsonResponse = new JsonSampleGenerator(service_model, exception).Execute(); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","AccessDeniedException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = StartAssessmentRunResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void StartAssessmentRun_AgentsAlreadyRunningAssessmentExceptionMarshallTest() { var operation = service_model.FindOperation("StartAssessmentRun"); var request = InstantiateClassGenerator.Execute(); var marshaller = new StartAssessmentRunRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var exception = operation.Exceptions.First(e => e.Name.Equals("AgentsAlreadyRunningAssessmentException")); var jsonResponse = new JsonSampleGenerator(service_model, exception).Execute(); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","AgentsAlreadyRunningAssessmentException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = StartAssessmentRunResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void StartAssessmentRun_InternalExceptionMarshallTest() { var operation = service_model.FindOperation("StartAssessmentRun"); var request = InstantiateClassGenerator.Execute(); var marshaller = new StartAssessmentRunRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var exception = operation.Exceptions.First(e => e.Name.Equals("InternalException")); var jsonResponse = new JsonSampleGenerator(service_model, exception).Execute(); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InternalException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = StartAssessmentRunResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void StartAssessmentRun_InvalidCrossAccountRoleExceptionMarshallTest() { var operation = service_model.FindOperation("StartAssessmentRun"); var request = InstantiateClassGenerator.Execute(); var marshaller = new StartAssessmentRunRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var exception = operation.Exceptions.First(e => e.Name.Equals("InvalidCrossAccountRoleException")); var jsonResponse = new JsonSampleGenerator(service_model, exception).Execute(); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InvalidCrossAccountRoleException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = StartAssessmentRunResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void StartAssessmentRun_InvalidInputExceptionMarshallTest() { var operation = service_model.FindOperation("StartAssessmentRun"); var request = InstantiateClassGenerator.Execute(); var marshaller = new StartAssessmentRunRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var exception = operation.Exceptions.First(e => e.Name.Equals("InvalidInputException")); var jsonResponse = new JsonSampleGenerator(service_model, exception).Execute(); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InvalidInputException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = StartAssessmentRunResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void StartAssessmentRun_LimitExceededExceptionMarshallTest() { var operation = service_model.FindOperation("StartAssessmentRun"); var request = InstantiateClassGenerator.Execute(); var marshaller = new StartAssessmentRunRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var exception = operation.Exceptions.First(e => e.Name.Equals("LimitExceededException")); var jsonResponse = new JsonSampleGenerator(service_model, exception).Execute(); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","LimitExceededException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = StartAssessmentRunResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void StartAssessmentRun_NoSuchEntityExceptionMarshallTest() { var operation = service_model.FindOperation("StartAssessmentRun"); var request = InstantiateClassGenerator.Execute(); var marshaller = new StartAssessmentRunRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var exception = operation.Exceptions.First(e => e.Name.Equals("NoSuchEntityException")); var jsonResponse = new JsonSampleGenerator(service_model, exception).Execute(); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","NoSuchEntityException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = StartAssessmentRunResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void StartAssessmentRun_ServiceTemporarilyUnavailableExceptionMarshallTest() { var operation = service_model.FindOperation("StartAssessmentRun"); var request = InstantiateClassGenerator.Execute(); var marshaller = new StartAssessmentRunRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var exception = operation.Exceptions.First(e => e.Name.Equals("ServiceTemporarilyUnavailableException")); var jsonResponse = new JsonSampleGenerator(service_model, exception).Execute(); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ServiceTemporarilyUnavailableException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = StartAssessmentRunResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void StopAssessmentRunMarshallTest() { var request = InstantiateClassGenerator.Execute(); var marshaller = new StopAssessmentRunRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void StopAssessmentRun_AccessDeniedExceptionMarshallTest() { var operation = service_model.FindOperation("StopAssessmentRun"); var request = InstantiateClassGenerator.Execute(); var marshaller = new StopAssessmentRunRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var exception = operation.Exceptions.First(e => e.Name.Equals("AccessDeniedException")); var jsonResponse = new JsonSampleGenerator(service_model, exception).Execute(); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","AccessDeniedException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = StopAssessmentRunResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void StopAssessmentRun_InternalExceptionMarshallTest() { var operation = service_model.FindOperation("StopAssessmentRun"); var request = InstantiateClassGenerator.Execute(); var marshaller = new StopAssessmentRunRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var exception = operation.Exceptions.First(e => e.Name.Equals("InternalException")); var jsonResponse = new JsonSampleGenerator(service_model, exception).Execute(); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InternalException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = StopAssessmentRunResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void StopAssessmentRun_InvalidInputExceptionMarshallTest() { var operation = service_model.FindOperation("StopAssessmentRun"); var request = InstantiateClassGenerator.Execute(); var marshaller = new StopAssessmentRunRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var exception = operation.Exceptions.First(e => e.Name.Equals("InvalidInputException")); var jsonResponse = new JsonSampleGenerator(service_model, exception).Execute(); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InvalidInputException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = StopAssessmentRunResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void StopAssessmentRun_NoSuchEntityExceptionMarshallTest() { var operation = service_model.FindOperation("StopAssessmentRun"); var request = InstantiateClassGenerator.Execute(); var marshaller = new StopAssessmentRunRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var exception = operation.Exceptions.First(e => e.Name.Equals("NoSuchEntityException")); var jsonResponse = new JsonSampleGenerator(service_model, exception).Execute(); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","NoSuchEntityException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = StopAssessmentRunResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void StopAssessmentRun_ServiceTemporarilyUnavailableExceptionMarshallTest() { var operation = service_model.FindOperation("StopAssessmentRun"); var request = InstantiateClassGenerator.Execute(); var marshaller = new StopAssessmentRunRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var exception = operation.Exceptions.First(e => e.Name.Equals("ServiceTemporarilyUnavailableException")); var jsonResponse = new JsonSampleGenerator(service_model, exception).Execute(); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ServiceTemporarilyUnavailableException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = StopAssessmentRunResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void SubscribeToEventMarshallTest() { var request = InstantiateClassGenerator.Execute(); var marshaller = new SubscribeToEventRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void SubscribeToEvent_AccessDeniedExceptionMarshallTest() { var operation = service_model.FindOperation("SubscribeToEvent"); var request = InstantiateClassGenerator.Execute(); var marshaller = new SubscribeToEventRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var exception = operation.Exceptions.First(e => e.Name.Equals("AccessDeniedException")); var jsonResponse = new JsonSampleGenerator(service_model, exception).Execute(); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","AccessDeniedException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = SubscribeToEventResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void SubscribeToEvent_InternalExceptionMarshallTest() { var operation = service_model.FindOperation("SubscribeToEvent"); var request = InstantiateClassGenerator.Execute(); var marshaller = new SubscribeToEventRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var exception = operation.Exceptions.First(e => e.Name.Equals("InternalException")); var jsonResponse = new JsonSampleGenerator(service_model, exception).Execute(); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InternalException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = SubscribeToEventResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void SubscribeToEvent_InvalidInputExceptionMarshallTest() { var operation = service_model.FindOperation("SubscribeToEvent"); var request = InstantiateClassGenerator.Execute(); var marshaller = new SubscribeToEventRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var exception = operation.Exceptions.First(e => e.Name.Equals("InvalidInputException")); var jsonResponse = new JsonSampleGenerator(service_model, exception).Execute(); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InvalidInputException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = SubscribeToEventResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void SubscribeToEvent_LimitExceededExceptionMarshallTest() { var operation = service_model.FindOperation("SubscribeToEvent"); var request = InstantiateClassGenerator.Execute(); var marshaller = new SubscribeToEventRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var exception = operation.Exceptions.First(e => e.Name.Equals("LimitExceededException")); var jsonResponse = new JsonSampleGenerator(service_model, exception).Execute(); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","LimitExceededException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = SubscribeToEventResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void SubscribeToEvent_NoSuchEntityExceptionMarshallTest() { var operation = service_model.FindOperation("SubscribeToEvent"); var request = InstantiateClassGenerator.Execute(); var marshaller = new SubscribeToEventRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var exception = operation.Exceptions.First(e => e.Name.Equals("NoSuchEntityException")); var jsonResponse = new JsonSampleGenerator(service_model, exception).Execute(); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","NoSuchEntityException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = SubscribeToEventResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void SubscribeToEvent_ServiceTemporarilyUnavailableExceptionMarshallTest() { var operation = service_model.FindOperation("SubscribeToEvent"); var request = InstantiateClassGenerator.Execute(); var marshaller = new SubscribeToEventRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var exception = operation.Exceptions.First(e => e.Name.Equals("ServiceTemporarilyUnavailableException")); var jsonResponse = new JsonSampleGenerator(service_model, exception).Execute(); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ServiceTemporarilyUnavailableException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = SubscribeToEventResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void UnsubscribeFromEventMarshallTest() { var request = InstantiateClassGenerator.Execute(); var marshaller = new UnsubscribeFromEventRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void UnsubscribeFromEvent_AccessDeniedExceptionMarshallTest() { var operation = service_model.FindOperation("UnsubscribeFromEvent"); var request = InstantiateClassGenerator.Execute(); var marshaller = new UnsubscribeFromEventRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var exception = operation.Exceptions.First(e => e.Name.Equals("AccessDeniedException")); var jsonResponse = new JsonSampleGenerator(service_model, exception).Execute(); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","AccessDeniedException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = UnsubscribeFromEventResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void UnsubscribeFromEvent_InternalExceptionMarshallTest() { var operation = service_model.FindOperation("UnsubscribeFromEvent"); var request = InstantiateClassGenerator.Execute(); var marshaller = new UnsubscribeFromEventRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var exception = operation.Exceptions.First(e => e.Name.Equals("InternalException")); var jsonResponse = new JsonSampleGenerator(service_model, exception).Execute(); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InternalException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = UnsubscribeFromEventResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void UnsubscribeFromEvent_InvalidInputExceptionMarshallTest() { var operation = service_model.FindOperation("UnsubscribeFromEvent"); var request = InstantiateClassGenerator.Execute(); var marshaller = new UnsubscribeFromEventRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var exception = operation.Exceptions.First(e => e.Name.Equals("InvalidInputException")); var jsonResponse = new JsonSampleGenerator(service_model, exception).Execute(); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InvalidInputException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = UnsubscribeFromEventResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void UnsubscribeFromEvent_NoSuchEntityExceptionMarshallTest() { var operation = service_model.FindOperation("UnsubscribeFromEvent"); var request = InstantiateClassGenerator.Execute(); var marshaller = new UnsubscribeFromEventRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var exception = operation.Exceptions.First(e => e.Name.Equals("NoSuchEntityException")); var jsonResponse = new JsonSampleGenerator(service_model, exception).Execute(); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","NoSuchEntityException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = UnsubscribeFromEventResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void UnsubscribeFromEvent_ServiceTemporarilyUnavailableExceptionMarshallTest() { var operation = service_model.FindOperation("UnsubscribeFromEvent"); var request = InstantiateClassGenerator.Execute(); var marshaller = new UnsubscribeFromEventRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var exception = operation.Exceptions.First(e => e.Name.Equals("ServiceTemporarilyUnavailableException")); var jsonResponse = new JsonSampleGenerator(service_model, exception).Execute(); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ServiceTemporarilyUnavailableException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = UnsubscribeFromEventResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void UpdateAssessmentTargetMarshallTest() { var request = InstantiateClassGenerator.Execute(); var marshaller = new UpdateAssessmentTargetRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void UpdateAssessmentTarget_AccessDeniedExceptionMarshallTest() { var operation = service_model.FindOperation("UpdateAssessmentTarget"); var request = InstantiateClassGenerator.Execute(); var marshaller = new UpdateAssessmentTargetRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var exception = operation.Exceptions.First(e => e.Name.Equals("AccessDeniedException")); var jsonResponse = new JsonSampleGenerator(service_model, exception).Execute(); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","AccessDeniedException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = UpdateAssessmentTargetResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void UpdateAssessmentTarget_InternalExceptionMarshallTest() { var operation = service_model.FindOperation("UpdateAssessmentTarget"); var request = InstantiateClassGenerator.Execute(); var marshaller = new UpdateAssessmentTargetRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var exception = operation.Exceptions.First(e => e.Name.Equals("InternalException")); var jsonResponse = new JsonSampleGenerator(service_model, exception).Execute(); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InternalException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = UpdateAssessmentTargetResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void UpdateAssessmentTarget_InvalidInputExceptionMarshallTest() { var operation = service_model.FindOperation("UpdateAssessmentTarget"); var request = InstantiateClassGenerator.Execute(); var marshaller = new UpdateAssessmentTargetRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var exception = operation.Exceptions.First(e => e.Name.Equals("InvalidInputException")); var jsonResponse = new JsonSampleGenerator(service_model, exception).Execute(); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InvalidInputException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = UpdateAssessmentTargetResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void UpdateAssessmentTarget_NoSuchEntityExceptionMarshallTest() { var operation = service_model.FindOperation("UpdateAssessmentTarget"); var request = InstantiateClassGenerator.Execute(); var marshaller = new UpdateAssessmentTargetRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var exception = operation.Exceptions.First(e => e.Name.Equals("NoSuchEntityException")); var jsonResponse = new JsonSampleGenerator(service_model, exception).Execute(); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","NoSuchEntityException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = UpdateAssessmentTargetResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("Inspector")] public void UpdateAssessmentTarget_ServiceTemporarilyUnavailableExceptionMarshallTest() { var operation = service_model.FindOperation("UpdateAssessmentTarget"); var request = InstantiateClassGenerator.Execute(); var marshaller = new UpdateAssessmentTargetRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); var exception = operation.Exceptions.First(e => e.Name.Equals("ServiceTemporarilyUnavailableException")); var jsonResponse = new JsonSampleGenerator(service_model, exception).Execute(); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ServiceTemporarilyUnavailableException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = UpdateAssessmentTargetResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } } }