/* * 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 codedeploy-2014-10-06.normal.json service model. */ using System; using System.IO; using System.Linq; using System.Text; using Microsoft.VisualStudio.TestTools.UnitTesting; using Amazon.CodeDeploy; using Amazon.CodeDeploy.Model; using Amazon.CodeDeploy.Model.Internal.MarshallTransformations; using Amazon.Runtime.Internal.Transform; using ServiceClientGenerator; using AWSSDK_DotNet35.UnitTests.TestTools; namespace AWSSDK_DotNet35.UnitTests.Marshalling { [TestClass] public class CodeDeployMarshallingTests { static readonly ServiceModel service_model = Utils.LoadServiceModel("codedeploy"); [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void AddTagsToOnPremisesInstancesMarshallTest() { var request = InstantiateClassGenerator.Execute(); var marshaller = new AddTagsToOnPremisesInstancesRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void AddTagsToOnPremisesInstances_InstanceLimitExceededExceptionMarshallTest() { var operation = service_model.FindOperation("AddTagsToOnPremisesInstances"); var request = InstantiateClassGenerator.Execute(); var marshaller = new AddTagsToOnPremisesInstancesRequestMarshaller(); 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("InstanceLimitExceededException")); 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","InstanceLimitExceededException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = AddTagsToOnPremisesInstancesResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void AddTagsToOnPremisesInstances_InstanceNameRequiredExceptionMarshallTest() { var operation = service_model.FindOperation("AddTagsToOnPremisesInstances"); var request = InstantiateClassGenerator.Execute(); var marshaller = new AddTagsToOnPremisesInstancesRequestMarshaller(); 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("InstanceNameRequiredException")); 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","InstanceNameRequiredException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = AddTagsToOnPremisesInstancesResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void AddTagsToOnPremisesInstances_InstanceNotRegisteredExceptionMarshallTest() { var operation = service_model.FindOperation("AddTagsToOnPremisesInstances"); var request = InstantiateClassGenerator.Execute(); var marshaller = new AddTagsToOnPremisesInstancesRequestMarshaller(); 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("InstanceNotRegisteredException")); 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","InstanceNotRegisteredException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = AddTagsToOnPremisesInstancesResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void AddTagsToOnPremisesInstances_InvalidInstanceNameExceptionMarshallTest() { var operation = service_model.FindOperation("AddTagsToOnPremisesInstances"); var request = InstantiateClassGenerator.Execute(); var marshaller = new AddTagsToOnPremisesInstancesRequestMarshaller(); 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("InvalidInstanceNameException")); 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","InvalidInstanceNameException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = AddTagsToOnPremisesInstancesResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void AddTagsToOnPremisesInstances_InvalidTagExceptionMarshallTest() { var operation = service_model.FindOperation("AddTagsToOnPremisesInstances"); var request = InstantiateClassGenerator.Execute(); var marshaller = new AddTagsToOnPremisesInstancesRequestMarshaller(); 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("InvalidTagException")); 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","InvalidTagException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = AddTagsToOnPremisesInstancesResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void AddTagsToOnPremisesInstances_TagLimitExceededExceptionMarshallTest() { var operation = service_model.FindOperation("AddTagsToOnPremisesInstances"); var request = InstantiateClassGenerator.Execute(); var marshaller = new AddTagsToOnPremisesInstancesRequestMarshaller(); 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("TagLimitExceededException")); 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","TagLimitExceededException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = AddTagsToOnPremisesInstancesResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void AddTagsToOnPremisesInstances_TagRequiredExceptionMarshallTest() { var operation = service_model.FindOperation("AddTagsToOnPremisesInstances"); var request = InstantiateClassGenerator.Execute(); var marshaller = new AddTagsToOnPremisesInstancesRequestMarshaller(); 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("TagRequiredException")); 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","TagRequiredException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = AddTagsToOnPremisesInstancesResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void BatchGetApplicationRevisionsMarshallTest() { var request = InstantiateClassGenerator.Execute(); var marshaller = new BatchGetApplicationRevisionsRequestMarshaller(); 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("BatchGetApplicationRevisions").ResponseStructure).Execute(); webResponse.Headers.Add("Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()); UnmarshallerContext context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), false, webResponse); var response = BatchGetApplicationRevisionsResponseUnmarshaller.Instance.Unmarshall(context) as BatchGetApplicationRevisionsResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void BatchGetApplicationRevisions_ApplicationDoesNotExistExceptionMarshallTest() { var operation = service_model.FindOperation("BatchGetApplicationRevisions"); var request = InstantiateClassGenerator.Execute(); var marshaller = new BatchGetApplicationRevisionsRequestMarshaller(); 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("ApplicationDoesNotExistException")); 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","ApplicationDoesNotExistException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = BatchGetApplicationRevisionsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void BatchGetApplicationRevisions_ApplicationNameRequiredExceptionMarshallTest() { var operation = service_model.FindOperation("BatchGetApplicationRevisions"); var request = InstantiateClassGenerator.Execute(); var marshaller = new BatchGetApplicationRevisionsRequestMarshaller(); 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("ApplicationNameRequiredException")); 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","ApplicationNameRequiredException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = BatchGetApplicationRevisionsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void BatchGetApplicationRevisions_BatchLimitExceededExceptionMarshallTest() { var operation = service_model.FindOperation("BatchGetApplicationRevisions"); var request = InstantiateClassGenerator.Execute(); var marshaller = new BatchGetApplicationRevisionsRequestMarshaller(); 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("BatchLimitExceededException")); 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","BatchLimitExceededException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = BatchGetApplicationRevisionsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void BatchGetApplicationRevisions_InvalidApplicationNameExceptionMarshallTest() { var operation = service_model.FindOperation("BatchGetApplicationRevisions"); var request = InstantiateClassGenerator.Execute(); var marshaller = new BatchGetApplicationRevisionsRequestMarshaller(); 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("InvalidApplicationNameException")); 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","InvalidApplicationNameException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = BatchGetApplicationRevisionsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void BatchGetApplicationRevisions_InvalidRevisionExceptionMarshallTest() { var operation = service_model.FindOperation("BatchGetApplicationRevisions"); var request = InstantiateClassGenerator.Execute(); var marshaller = new BatchGetApplicationRevisionsRequestMarshaller(); 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("InvalidRevisionException")); 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","InvalidRevisionException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = BatchGetApplicationRevisionsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void BatchGetApplicationRevisions_RevisionRequiredExceptionMarshallTest() { var operation = service_model.FindOperation("BatchGetApplicationRevisions"); var request = InstantiateClassGenerator.Execute(); var marshaller = new BatchGetApplicationRevisionsRequestMarshaller(); 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("RevisionRequiredException")); 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","RevisionRequiredException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = BatchGetApplicationRevisionsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void BatchGetApplicationsMarshallTest() { var request = InstantiateClassGenerator.Execute(); var marshaller = new BatchGetApplicationsRequestMarshaller(); 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("BatchGetApplications").ResponseStructure).Execute(); webResponse.Headers.Add("Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()); UnmarshallerContext context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), false, webResponse); var response = BatchGetApplicationsResponseUnmarshaller.Instance.Unmarshall(context) as BatchGetApplicationsResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void BatchGetApplications_ApplicationDoesNotExistExceptionMarshallTest() { var operation = service_model.FindOperation("BatchGetApplications"); var request = InstantiateClassGenerator.Execute(); var marshaller = new BatchGetApplicationsRequestMarshaller(); 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("ApplicationDoesNotExistException")); 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","ApplicationDoesNotExistException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = BatchGetApplicationsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void BatchGetApplications_ApplicationNameRequiredExceptionMarshallTest() { var operation = service_model.FindOperation("BatchGetApplications"); var request = InstantiateClassGenerator.Execute(); var marshaller = new BatchGetApplicationsRequestMarshaller(); 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("ApplicationNameRequiredException")); 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","ApplicationNameRequiredException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = BatchGetApplicationsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void BatchGetApplications_BatchLimitExceededExceptionMarshallTest() { var operation = service_model.FindOperation("BatchGetApplications"); var request = InstantiateClassGenerator.Execute(); var marshaller = new BatchGetApplicationsRequestMarshaller(); 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("BatchLimitExceededException")); 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","BatchLimitExceededException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = BatchGetApplicationsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void BatchGetApplications_InvalidApplicationNameExceptionMarshallTest() { var operation = service_model.FindOperation("BatchGetApplications"); var request = InstantiateClassGenerator.Execute(); var marshaller = new BatchGetApplicationsRequestMarshaller(); 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("InvalidApplicationNameException")); 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","InvalidApplicationNameException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = BatchGetApplicationsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void BatchGetDeploymentGroupsMarshallTest() { var request = InstantiateClassGenerator.Execute(); var marshaller = new BatchGetDeploymentGroupsRequestMarshaller(); 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("BatchGetDeploymentGroups").ResponseStructure).Execute(); webResponse.Headers.Add("Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()); UnmarshallerContext context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), false, webResponse); var response = BatchGetDeploymentGroupsResponseUnmarshaller.Instance.Unmarshall(context) as BatchGetDeploymentGroupsResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void BatchGetDeploymentGroups_ApplicationDoesNotExistExceptionMarshallTest() { var operation = service_model.FindOperation("BatchGetDeploymentGroups"); var request = InstantiateClassGenerator.Execute(); var marshaller = new BatchGetDeploymentGroupsRequestMarshaller(); 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("ApplicationDoesNotExistException")); 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","ApplicationDoesNotExistException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = BatchGetDeploymentGroupsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void BatchGetDeploymentGroups_ApplicationNameRequiredExceptionMarshallTest() { var operation = service_model.FindOperation("BatchGetDeploymentGroups"); var request = InstantiateClassGenerator.Execute(); var marshaller = new BatchGetDeploymentGroupsRequestMarshaller(); 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("ApplicationNameRequiredException")); 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","ApplicationNameRequiredException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = BatchGetDeploymentGroupsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void BatchGetDeploymentGroups_BatchLimitExceededExceptionMarshallTest() { var operation = service_model.FindOperation("BatchGetDeploymentGroups"); var request = InstantiateClassGenerator.Execute(); var marshaller = new BatchGetDeploymentGroupsRequestMarshaller(); 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("BatchLimitExceededException")); 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","BatchLimitExceededException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = BatchGetDeploymentGroupsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void BatchGetDeploymentGroups_DeploymentConfigDoesNotExistExceptionMarshallTest() { var operation = service_model.FindOperation("BatchGetDeploymentGroups"); var request = InstantiateClassGenerator.Execute(); var marshaller = new BatchGetDeploymentGroupsRequestMarshaller(); 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("DeploymentConfigDoesNotExistException")); 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","DeploymentConfigDoesNotExistException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = BatchGetDeploymentGroupsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void BatchGetDeploymentGroups_DeploymentGroupNameRequiredExceptionMarshallTest() { var operation = service_model.FindOperation("BatchGetDeploymentGroups"); var request = InstantiateClassGenerator.Execute(); var marshaller = new BatchGetDeploymentGroupsRequestMarshaller(); 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("DeploymentGroupNameRequiredException")); 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","DeploymentGroupNameRequiredException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = BatchGetDeploymentGroupsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void BatchGetDeploymentGroups_InvalidApplicationNameExceptionMarshallTest() { var operation = service_model.FindOperation("BatchGetDeploymentGroups"); var request = InstantiateClassGenerator.Execute(); var marshaller = new BatchGetDeploymentGroupsRequestMarshaller(); 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("InvalidApplicationNameException")); 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","InvalidApplicationNameException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = BatchGetDeploymentGroupsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void BatchGetDeploymentGroups_InvalidDeploymentGroupNameExceptionMarshallTest() { var operation = service_model.FindOperation("BatchGetDeploymentGroups"); var request = InstantiateClassGenerator.Execute(); var marshaller = new BatchGetDeploymentGroupsRequestMarshaller(); 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("InvalidDeploymentGroupNameException")); 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","InvalidDeploymentGroupNameException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = BatchGetDeploymentGroupsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void BatchGetDeploymentInstancesMarshallTest() { var request = InstantiateClassGenerator.Execute(); var marshaller = new BatchGetDeploymentInstancesRequestMarshaller(); 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("BatchGetDeploymentInstances").ResponseStructure).Execute(); webResponse.Headers.Add("Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()); UnmarshallerContext context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), false, webResponse); var response = BatchGetDeploymentInstancesResponseUnmarshaller.Instance.Unmarshall(context) as BatchGetDeploymentInstancesResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void BatchGetDeploymentInstances_BatchLimitExceededExceptionMarshallTest() { var operation = service_model.FindOperation("BatchGetDeploymentInstances"); var request = InstantiateClassGenerator.Execute(); var marshaller = new BatchGetDeploymentInstancesRequestMarshaller(); 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("BatchLimitExceededException")); 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","BatchLimitExceededException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = BatchGetDeploymentInstancesResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void BatchGetDeploymentInstances_DeploymentDoesNotExistExceptionMarshallTest() { var operation = service_model.FindOperation("BatchGetDeploymentInstances"); var request = InstantiateClassGenerator.Execute(); var marshaller = new BatchGetDeploymentInstancesRequestMarshaller(); 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("DeploymentDoesNotExistException")); 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","DeploymentDoesNotExistException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = BatchGetDeploymentInstancesResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void BatchGetDeploymentInstances_DeploymentIdRequiredExceptionMarshallTest() { var operation = service_model.FindOperation("BatchGetDeploymentInstances"); var request = InstantiateClassGenerator.Execute(); var marshaller = new BatchGetDeploymentInstancesRequestMarshaller(); 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("DeploymentIdRequiredException")); 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","DeploymentIdRequiredException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = BatchGetDeploymentInstancesResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void BatchGetDeploymentInstances_InstanceIdRequiredExceptionMarshallTest() { var operation = service_model.FindOperation("BatchGetDeploymentInstances"); var request = InstantiateClassGenerator.Execute(); var marshaller = new BatchGetDeploymentInstancesRequestMarshaller(); 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("InstanceIdRequiredException")); 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","InstanceIdRequiredException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = BatchGetDeploymentInstancesResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void BatchGetDeploymentInstances_InvalidComputePlatformExceptionMarshallTest() { var operation = service_model.FindOperation("BatchGetDeploymentInstances"); var request = InstantiateClassGenerator.Execute(); var marshaller = new BatchGetDeploymentInstancesRequestMarshaller(); 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("InvalidComputePlatformException")); 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","InvalidComputePlatformException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = BatchGetDeploymentInstancesResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void BatchGetDeploymentInstances_InvalidDeploymentIdExceptionMarshallTest() { var operation = service_model.FindOperation("BatchGetDeploymentInstances"); var request = InstantiateClassGenerator.Execute(); var marshaller = new BatchGetDeploymentInstancesRequestMarshaller(); 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("InvalidDeploymentIdException")); 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","InvalidDeploymentIdException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = BatchGetDeploymentInstancesResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void BatchGetDeploymentInstances_InvalidInstanceNameExceptionMarshallTest() { var operation = service_model.FindOperation("BatchGetDeploymentInstances"); var request = InstantiateClassGenerator.Execute(); var marshaller = new BatchGetDeploymentInstancesRequestMarshaller(); 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("InvalidInstanceNameException")); 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","InvalidInstanceNameException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = BatchGetDeploymentInstancesResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void BatchGetDeploymentsMarshallTest() { var request = InstantiateClassGenerator.Execute(); var marshaller = new BatchGetDeploymentsRequestMarshaller(); 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("BatchGetDeployments").ResponseStructure).Execute(); webResponse.Headers.Add("Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()); UnmarshallerContext context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), false, webResponse); var response = BatchGetDeploymentsResponseUnmarshaller.Instance.Unmarshall(context) as BatchGetDeploymentsResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void BatchGetDeployments_BatchLimitExceededExceptionMarshallTest() { var operation = service_model.FindOperation("BatchGetDeployments"); var request = InstantiateClassGenerator.Execute(); var marshaller = new BatchGetDeploymentsRequestMarshaller(); 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("BatchLimitExceededException")); 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","BatchLimitExceededException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = BatchGetDeploymentsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void BatchGetDeployments_DeploymentIdRequiredExceptionMarshallTest() { var operation = service_model.FindOperation("BatchGetDeployments"); var request = InstantiateClassGenerator.Execute(); var marshaller = new BatchGetDeploymentsRequestMarshaller(); 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("DeploymentIdRequiredException")); 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","DeploymentIdRequiredException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = BatchGetDeploymentsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void BatchGetDeployments_InvalidDeploymentIdExceptionMarshallTest() { var operation = service_model.FindOperation("BatchGetDeployments"); var request = InstantiateClassGenerator.Execute(); var marshaller = new BatchGetDeploymentsRequestMarshaller(); 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("InvalidDeploymentIdException")); 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","InvalidDeploymentIdException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = BatchGetDeploymentsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void BatchGetDeploymentTargetsMarshallTest() { var request = InstantiateClassGenerator.Execute(); var marshaller = new BatchGetDeploymentTargetsRequestMarshaller(); 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("BatchGetDeploymentTargets").ResponseStructure).Execute(); webResponse.Headers.Add("Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()); UnmarshallerContext context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), false, webResponse); var response = BatchGetDeploymentTargetsResponseUnmarshaller.Instance.Unmarshall(context) as BatchGetDeploymentTargetsResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void BatchGetDeploymentTargets_DeploymentDoesNotExistExceptionMarshallTest() { var operation = service_model.FindOperation("BatchGetDeploymentTargets"); var request = InstantiateClassGenerator.Execute(); var marshaller = new BatchGetDeploymentTargetsRequestMarshaller(); 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("DeploymentDoesNotExistException")); 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","DeploymentDoesNotExistException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = BatchGetDeploymentTargetsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void BatchGetDeploymentTargets_DeploymentIdRequiredExceptionMarshallTest() { var operation = service_model.FindOperation("BatchGetDeploymentTargets"); var request = InstantiateClassGenerator.Execute(); var marshaller = new BatchGetDeploymentTargetsRequestMarshaller(); 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("DeploymentIdRequiredException")); 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","DeploymentIdRequiredException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = BatchGetDeploymentTargetsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void BatchGetDeploymentTargets_DeploymentNotStartedExceptionMarshallTest() { var operation = service_model.FindOperation("BatchGetDeploymentTargets"); var request = InstantiateClassGenerator.Execute(); var marshaller = new BatchGetDeploymentTargetsRequestMarshaller(); 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("DeploymentNotStartedException")); 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","DeploymentNotStartedException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = BatchGetDeploymentTargetsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void BatchGetDeploymentTargets_DeploymentTargetDoesNotExistExceptionMarshallTest() { var operation = service_model.FindOperation("BatchGetDeploymentTargets"); var request = InstantiateClassGenerator.Execute(); var marshaller = new BatchGetDeploymentTargetsRequestMarshaller(); 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("DeploymentTargetDoesNotExistException")); 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","DeploymentTargetDoesNotExistException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = BatchGetDeploymentTargetsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void BatchGetDeploymentTargets_DeploymentTargetIdRequiredExceptionMarshallTest() { var operation = service_model.FindOperation("BatchGetDeploymentTargets"); var request = InstantiateClassGenerator.Execute(); var marshaller = new BatchGetDeploymentTargetsRequestMarshaller(); 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("DeploymentTargetIdRequiredException")); 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","DeploymentTargetIdRequiredException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = BatchGetDeploymentTargetsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void BatchGetDeploymentTargets_DeploymentTargetListSizeExceededExceptionMarshallTest() { var operation = service_model.FindOperation("BatchGetDeploymentTargets"); var request = InstantiateClassGenerator.Execute(); var marshaller = new BatchGetDeploymentTargetsRequestMarshaller(); 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("DeploymentTargetListSizeExceededException")); 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","DeploymentTargetListSizeExceededException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = BatchGetDeploymentTargetsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void BatchGetDeploymentTargets_InstanceDoesNotExistExceptionMarshallTest() { var operation = service_model.FindOperation("BatchGetDeploymentTargets"); var request = InstantiateClassGenerator.Execute(); var marshaller = new BatchGetDeploymentTargetsRequestMarshaller(); 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("InstanceDoesNotExistException")); 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","InstanceDoesNotExistException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = BatchGetDeploymentTargetsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void BatchGetDeploymentTargets_InvalidDeploymentIdExceptionMarshallTest() { var operation = service_model.FindOperation("BatchGetDeploymentTargets"); var request = InstantiateClassGenerator.Execute(); var marshaller = new BatchGetDeploymentTargetsRequestMarshaller(); 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("InvalidDeploymentIdException")); 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","InvalidDeploymentIdException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = BatchGetDeploymentTargetsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void BatchGetDeploymentTargets_InvalidDeploymentTargetIdExceptionMarshallTest() { var operation = service_model.FindOperation("BatchGetDeploymentTargets"); var request = InstantiateClassGenerator.Execute(); var marshaller = new BatchGetDeploymentTargetsRequestMarshaller(); 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("InvalidDeploymentTargetIdException")); 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","InvalidDeploymentTargetIdException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = BatchGetDeploymentTargetsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void BatchGetOnPremisesInstancesMarshallTest() { var request = InstantiateClassGenerator.Execute(); var marshaller = new BatchGetOnPremisesInstancesRequestMarshaller(); 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("BatchGetOnPremisesInstances").ResponseStructure).Execute(); webResponse.Headers.Add("Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()); UnmarshallerContext context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), false, webResponse); var response = BatchGetOnPremisesInstancesResponseUnmarshaller.Instance.Unmarshall(context) as BatchGetOnPremisesInstancesResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void BatchGetOnPremisesInstances_BatchLimitExceededExceptionMarshallTest() { var operation = service_model.FindOperation("BatchGetOnPremisesInstances"); var request = InstantiateClassGenerator.Execute(); var marshaller = new BatchGetOnPremisesInstancesRequestMarshaller(); 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("BatchLimitExceededException")); 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","BatchLimitExceededException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = BatchGetOnPremisesInstancesResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void BatchGetOnPremisesInstances_InstanceNameRequiredExceptionMarshallTest() { var operation = service_model.FindOperation("BatchGetOnPremisesInstances"); var request = InstantiateClassGenerator.Execute(); var marshaller = new BatchGetOnPremisesInstancesRequestMarshaller(); 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("InstanceNameRequiredException")); 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","InstanceNameRequiredException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = BatchGetOnPremisesInstancesResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void BatchGetOnPremisesInstances_InvalidInstanceNameExceptionMarshallTest() { var operation = service_model.FindOperation("BatchGetOnPremisesInstances"); var request = InstantiateClassGenerator.Execute(); var marshaller = new BatchGetOnPremisesInstancesRequestMarshaller(); 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("InvalidInstanceNameException")); 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","InvalidInstanceNameException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = BatchGetOnPremisesInstancesResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void ContinueDeploymentMarshallTest() { var request = InstantiateClassGenerator.Execute(); var marshaller = new ContinueDeploymentRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void ContinueDeployment_DeploymentAlreadyCompletedExceptionMarshallTest() { var operation = service_model.FindOperation("ContinueDeployment"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ContinueDeploymentRequestMarshaller(); 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("DeploymentAlreadyCompletedException")); 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","DeploymentAlreadyCompletedException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = ContinueDeploymentResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void ContinueDeployment_DeploymentDoesNotExistExceptionMarshallTest() { var operation = service_model.FindOperation("ContinueDeployment"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ContinueDeploymentRequestMarshaller(); 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("DeploymentDoesNotExistException")); 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","DeploymentDoesNotExistException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = ContinueDeploymentResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void ContinueDeployment_DeploymentIdRequiredExceptionMarshallTest() { var operation = service_model.FindOperation("ContinueDeployment"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ContinueDeploymentRequestMarshaller(); 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("DeploymentIdRequiredException")); 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","DeploymentIdRequiredException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = ContinueDeploymentResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void ContinueDeployment_DeploymentIsNotInReadyStateExceptionMarshallTest() { var operation = service_model.FindOperation("ContinueDeployment"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ContinueDeploymentRequestMarshaller(); 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("DeploymentIsNotInReadyStateException")); 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","DeploymentIsNotInReadyStateException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = ContinueDeploymentResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void ContinueDeployment_InvalidDeploymentIdExceptionMarshallTest() { var operation = service_model.FindOperation("ContinueDeployment"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ContinueDeploymentRequestMarshaller(); 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("InvalidDeploymentIdException")); 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","InvalidDeploymentIdException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = ContinueDeploymentResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void ContinueDeployment_InvalidDeploymentStatusExceptionMarshallTest() { var operation = service_model.FindOperation("ContinueDeployment"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ContinueDeploymentRequestMarshaller(); 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("InvalidDeploymentStatusException")); 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","InvalidDeploymentStatusException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = ContinueDeploymentResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void ContinueDeployment_InvalidDeploymentWaitTypeExceptionMarshallTest() { var operation = service_model.FindOperation("ContinueDeployment"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ContinueDeploymentRequestMarshaller(); 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("InvalidDeploymentWaitTypeException")); 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","InvalidDeploymentWaitTypeException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = ContinueDeploymentResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void ContinueDeployment_UnsupportedActionForDeploymentTypeExceptionMarshallTest() { var operation = service_model.FindOperation("ContinueDeployment"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ContinueDeploymentRequestMarshaller(); 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("UnsupportedActionForDeploymentTypeException")); 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","UnsupportedActionForDeploymentTypeException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = ContinueDeploymentResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void CreateApplicationMarshallTest() { var request = InstantiateClassGenerator.Execute(); var marshaller = new CreateApplicationRequestMarshaller(); 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("CreateApplication").ResponseStructure).Execute(); webResponse.Headers.Add("Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()); UnmarshallerContext context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), false, webResponse); var response = CreateApplicationResponseUnmarshaller.Instance.Unmarshall(context) as CreateApplicationResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void CreateApplication_ApplicationAlreadyExistsExceptionMarshallTest() { var operation = service_model.FindOperation("CreateApplication"); var request = InstantiateClassGenerator.Execute(); var marshaller = new CreateApplicationRequestMarshaller(); 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("ApplicationAlreadyExistsException")); 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","ApplicationAlreadyExistsException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = CreateApplicationResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void CreateApplication_ApplicationLimitExceededExceptionMarshallTest() { var operation = service_model.FindOperation("CreateApplication"); var request = InstantiateClassGenerator.Execute(); var marshaller = new CreateApplicationRequestMarshaller(); 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("ApplicationLimitExceededException")); 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","ApplicationLimitExceededException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = CreateApplicationResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void CreateApplication_ApplicationNameRequiredExceptionMarshallTest() { var operation = service_model.FindOperation("CreateApplication"); var request = InstantiateClassGenerator.Execute(); var marshaller = new CreateApplicationRequestMarshaller(); 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("ApplicationNameRequiredException")); 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","ApplicationNameRequiredException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = CreateApplicationResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void CreateApplication_InvalidApplicationNameExceptionMarshallTest() { var operation = service_model.FindOperation("CreateApplication"); var request = InstantiateClassGenerator.Execute(); var marshaller = new CreateApplicationRequestMarshaller(); 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("InvalidApplicationNameException")); 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","InvalidApplicationNameException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = CreateApplicationResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void CreateApplication_InvalidComputePlatformExceptionMarshallTest() { var operation = service_model.FindOperation("CreateApplication"); var request = InstantiateClassGenerator.Execute(); var marshaller = new CreateApplicationRequestMarshaller(); 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("InvalidComputePlatformException")); 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","InvalidComputePlatformException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = CreateApplicationResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void CreateApplication_InvalidTagsToAddExceptionMarshallTest() { var operation = service_model.FindOperation("CreateApplication"); var request = InstantiateClassGenerator.Execute(); var marshaller = new CreateApplicationRequestMarshaller(); 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("InvalidTagsToAddException")); 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","InvalidTagsToAddException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = CreateApplicationResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void CreateDeploymentMarshallTest() { var request = InstantiateClassGenerator.Execute(); var marshaller = new CreateDeploymentRequestMarshaller(); 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("CreateDeployment").ResponseStructure).Execute(); webResponse.Headers.Add("Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()); UnmarshallerContext context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), false, webResponse); var response = CreateDeploymentResponseUnmarshaller.Instance.Unmarshall(context) as CreateDeploymentResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void CreateDeployment_AlarmsLimitExceededExceptionMarshallTest() { var operation = service_model.FindOperation("CreateDeployment"); var request = InstantiateClassGenerator.Execute(); var marshaller = new CreateDeploymentRequestMarshaller(); 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("AlarmsLimitExceededException")); 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","AlarmsLimitExceededException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = CreateDeploymentResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void CreateDeployment_ApplicationDoesNotExistExceptionMarshallTest() { var operation = service_model.FindOperation("CreateDeployment"); var request = InstantiateClassGenerator.Execute(); var marshaller = new CreateDeploymentRequestMarshaller(); 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("ApplicationDoesNotExistException")); 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","ApplicationDoesNotExistException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = CreateDeploymentResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void CreateDeployment_ApplicationNameRequiredExceptionMarshallTest() { var operation = service_model.FindOperation("CreateDeployment"); var request = InstantiateClassGenerator.Execute(); var marshaller = new CreateDeploymentRequestMarshaller(); 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("ApplicationNameRequiredException")); 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","ApplicationNameRequiredException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = CreateDeploymentResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void CreateDeployment_DeploymentConfigDoesNotExistExceptionMarshallTest() { var operation = service_model.FindOperation("CreateDeployment"); var request = InstantiateClassGenerator.Execute(); var marshaller = new CreateDeploymentRequestMarshaller(); 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("DeploymentConfigDoesNotExistException")); 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","DeploymentConfigDoesNotExistException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = CreateDeploymentResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void CreateDeployment_DeploymentGroupDoesNotExistExceptionMarshallTest() { var operation = service_model.FindOperation("CreateDeployment"); var request = InstantiateClassGenerator.Execute(); var marshaller = new CreateDeploymentRequestMarshaller(); 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("DeploymentGroupDoesNotExistException")); 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","DeploymentGroupDoesNotExistException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = CreateDeploymentResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void CreateDeployment_DeploymentGroupNameRequiredExceptionMarshallTest() { var operation = service_model.FindOperation("CreateDeployment"); var request = InstantiateClassGenerator.Execute(); var marshaller = new CreateDeploymentRequestMarshaller(); 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("DeploymentGroupNameRequiredException")); 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","DeploymentGroupNameRequiredException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = CreateDeploymentResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void CreateDeployment_DeploymentLimitExceededExceptionMarshallTest() { var operation = service_model.FindOperation("CreateDeployment"); var request = InstantiateClassGenerator.Execute(); var marshaller = new CreateDeploymentRequestMarshaller(); 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("DeploymentLimitExceededException")); 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","DeploymentLimitExceededException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = CreateDeploymentResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void CreateDeployment_DescriptionTooLongExceptionMarshallTest() { var operation = service_model.FindOperation("CreateDeployment"); var request = InstantiateClassGenerator.Execute(); var marshaller = new CreateDeploymentRequestMarshaller(); 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("DescriptionTooLongException")); 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","DescriptionTooLongException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = CreateDeploymentResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void CreateDeployment_InvalidAlarmConfigExceptionMarshallTest() { var operation = service_model.FindOperation("CreateDeployment"); var request = InstantiateClassGenerator.Execute(); var marshaller = new CreateDeploymentRequestMarshaller(); 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("InvalidAlarmConfigException")); 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","InvalidAlarmConfigException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = CreateDeploymentResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void CreateDeployment_InvalidApplicationNameExceptionMarshallTest() { var operation = service_model.FindOperation("CreateDeployment"); var request = InstantiateClassGenerator.Execute(); var marshaller = new CreateDeploymentRequestMarshaller(); 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("InvalidApplicationNameException")); 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","InvalidApplicationNameException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = CreateDeploymentResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void CreateDeployment_InvalidAutoRollbackConfigExceptionMarshallTest() { var operation = service_model.FindOperation("CreateDeployment"); var request = InstantiateClassGenerator.Execute(); var marshaller = new CreateDeploymentRequestMarshaller(); 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("InvalidAutoRollbackConfigException")); 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","InvalidAutoRollbackConfigException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = CreateDeploymentResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void CreateDeployment_InvalidAutoScalingGroupExceptionMarshallTest() { var operation = service_model.FindOperation("CreateDeployment"); var request = InstantiateClassGenerator.Execute(); var marshaller = new CreateDeploymentRequestMarshaller(); 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("InvalidAutoScalingGroupException")); 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","InvalidAutoScalingGroupException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = CreateDeploymentResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void CreateDeployment_InvalidDeploymentConfigNameExceptionMarshallTest() { var operation = service_model.FindOperation("CreateDeployment"); var request = InstantiateClassGenerator.Execute(); var marshaller = new CreateDeploymentRequestMarshaller(); 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("InvalidDeploymentConfigNameException")); 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","InvalidDeploymentConfigNameException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = CreateDeploymentResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void CreateDeployment_InvalidDeploymentGroupNameExceptionMarshallTest() { var operation = service_model.FindOperation("CreateDeployment"); var request = InstantiateClassGenerator.Execute(); var marshaller = new CreateDeploymentRequestMarshaller(); 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("InvalidDeploymentGroupNameException")); 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","InvalidDeploymentGroupNameException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = CreateDeploymentResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void CreateDeployment_InvalidFileExistsBehaviorExceptionMarshallTest() { var operation = service_model.FindOperation("CreateDeployment"); var request = InstantiateClassGenerator.Execute(); var marshaller = new CreateDeploymentRequestMarshaller(); 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("InvalidFileExistsBehaviorException")); 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","InvalidFileExistsBehaviorException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = CreateDeploymentResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void CreateDeployment_InvalidGitHubAccountTokenExceptionMarshallTest() { var operation = service_model.FindOperation("CreateDeployment"); var request = InstantiateClassGenerator.Execute(); var marshaller = new CreateDeploymentRequestMarshaller(); 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("InvalidGitHubAccountTokenException")); 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","InvalidGitHubAccountTokenException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = CreateDeploymentResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void CreateDeployment_InvalidIgnoreApplicationStopFailuresValueExceptionMarshallTest() { var operation = service_model.FindOperation("CreateDeployment"); var request = InstantiateClassGenerator.Execute(); var marshaller = new CreateDeploymentRequestMarshaller(); 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("InvalidIgnoreApplicationStopFailuresValueException")); 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","InvalidIgnoreApplicationStopFailuresValueException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = CreateDeploymentResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void CreateDeployment_InvalidLoadBalancerInfoExceptionMarshallTest() { var operation = service_model.FindOperation("CreateDeployment"); var request = InstantiateClassGenerator.Execute(); var marshaller = new CreateDeploymentRequestMarshaller(); 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("InvalidLoadBalancerInfoException")); 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","InvalidLoadBalancerInfoException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = CreateDeploymentResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void CreateDeployment_InvalidRevisionExceptionMarshallTest() { var operation = service_model.FindOperation("CreateDeployment"); var request = InstantiateClassGenerator.Execute(); var marshaller = new CreateDeploymentRequestMarshaller(); 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("InvalidRevisionException")); 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","InvalidRevisionException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = CreateDeploymentResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void CreateDeployment_InvalidRoleExceptionMarshallTest() { var operation = service_model.FindOperation("CreateDeployment"); var request = InstantiateClassGenerator.Execute(); var marshaller = new CreateDeploymentRequestMarshaller(); 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("InvalidRoleException")); 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","InvalidRoleException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = CreateDeploymentResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void CreateDeployment_InvalidTargetInstancesExceptionMarshallTest() { var operation = service_model.FindOperation("CreateDeployment"); var request = InstantiateClassGenerator.Execute(); var marshaller = new CreateDeploymentRequestMarshaller(); 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("InvalidTargetInstancesException")); 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","InvalidTargetInstancesException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = CreateDeploymentResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void CreateDeployment_InvalidTrafficRoutingConfigurationExceptionMarshallTest() { var operation = service_model.FindOperation("CreateDeployment"); var request = InstantiateClassGenerator.Execute(); var marshaller = new CreateDeploymentRequestMarshaller(); 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("InvalidTrafficRoutingConfigurationException")); 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","InvalidTrafficRoutingConfigurationException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = CreateDeploymentResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void CreateDeployment_InvalidUpdateOutdatedInstancesOnlyValueExceptionMarshallTest() { var operation = service_model.FindOperation("CreateDeployment"); var request = InstantiateClassGenerator.Execute(); var marshaller = new CreateDeploymentRequestMarshaller(); 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("InvalidUpdateOutdatedInstancesOnlyValueException")); 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","InvalidUpdateOutdatedInstancesOnlyValueException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = CreateDeploymentResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void CreateDeployment_RevisionDoesNotExistExceptionMarshallTest() { var operation = service_model.FindOperation("CreateDeployment"); var request = InstantiateClassGenerator.Execute(); var marshaller = new CreateDeploymentRequestMarshaller(); 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("RevisionDoesNotExistException")); 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","RevisionDoesNotExistException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = CreateDeploymentResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void CreateDeployment_RevisionRequiredExceptionMarshallTest() { var operation = service_model.FindOperation("CreateDeployment"); var request = InstantiateClassGenerator.Execute(); var marshaller = new CreateDeploymentRequestMarshaller(); 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("RevisionRequiredException")); 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","RevisionRequiredException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = CreateDeploymentResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void CreateDeployment_ThrottlingExceptionMarshallTest() { var operation = service_model.FindOperation("CreateDeployment"); var request = InstantiateClassGenerator.Execute(); var marshaller = new CreateDeploymentRequestMarshaller(); 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("ThrottlingException")); 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","ThrottlingException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = CreateDeploymentResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void CreateDeploymentConfigMarshallTest() { var request = InstantiateClassGenerator.Execute(); var marshaller = new CreateDeploymentConfigRequestMarshaller(); 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("CreateDeploymentConfig").ResponseStructure).Execute(); webResponse.Headers.Add("Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()); UnmarshallerContext context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), false, webResponse); var response = CreateDeploymentConfigResponseUnmarshaller.Instance.Unmarshall(context) as CreateDeploymentConfigResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void CreateDeploymentConfig_DeploymentConfigAlreadyExistsExceptionMarshallTest() { var operation = service_model.FindOperation("CreateDeploymentConfig"); var request = InstantiateClassGenerator.Execute(); var marshaller = new CreateDeploymentConfigRequestMarshaller(); 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("DeploymentConfigAlreadyExistsException")); 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","DeploymentConfigAlreadyExistsException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = CreateDeploymentConfigResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void CreateDeploymentConfig_DeploymentConfigLimitExceededExceptionMarshallTest() { var operation = service_model.FindOperation("CreateDeploymentConfig"); var request = InstantiateClassGenerator.Execute(); var marshaller = new CreateDeploymentConfigRequestMarshaller(); 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("DeploymentConfigLimitExceededException")); 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","DeploymentConfigLimitExceededException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = CreateDeploymentConfigResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void CreateDeploymentConfig_DeploymentConfigNameRequiredExceptionMarshallTest() { var operation = service_model.FindOperation("CreateDeploymentConfig"); var request = InstantiateClassGenerator.Execute(); var marshaller = new CreateDeploymentConfigRequestMarshaller(); 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("DeploymentConfigNameRequiredException")); 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","DeploymentConfigNameRequiredException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = CreateDeploymentConfigResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void CreateDeploymentConfig_InvalidComputePlatformExceptionMarshallTest() { var operation = service_model.FindOperation("CreateDeploymentConfig"); var request = InstantiateClassGenerator.Execute(); var marshaller = new CreateDeploymentConfigRequestMarshaller(); 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("InvalidComputePlatformException")); 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","InvalidComputePlatformException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = CreateDeploymentConfigResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void CreateDeploymentConfig_InvalidDeploymentConfigNameExceptionMarshallTest() { var operation = service_model.FindOperation("CreateDeploymentConfig"); var request = InstantiateClassGenerator.Execute(); var marshaller = new CreateDeploymentConfigRequestMarshaller(); 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("InvalidDeploymentConfigNameException")); 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","InvalidDeploymentConfigNameException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = CreateDeploymentConfigResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void CreateDeploymentConfig_InvalidMinimumHealthyHostValueExceptionMarshallTest() { var operation = service_model.FindOperation("CreateDeploymentConfig"); var request = InstantiateClassGenerator.Execute(); var marshaller = new CreateDeploymentConfigRequestMarshaller(); 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("InvalidMinimumHealthyHostValueException")); 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","InvalidMinimumHealthyHostValueException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = CreateDeploymentConfigResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void CreateDeploymentConfig_InvalidTrafficRoutingConfigurationExceptionMarshallTest() { var operation = service_model.FindOperation("CreateDeploymentConfig"); var request = InstantiateClassGenerator.Execute(); var marshaller = new CreateDeploymentConfigRequestMarshaller(); 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("InvalidTrafficRoutingConfigurationException")); 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","InvalidTrafficRoutingConfigurationException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = CreateDeploymentConfigResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void CreateDeploymentGroupMarshallTest() { var request = InstantiateClassGenerator.Execute(); var marshaller = new CreateDeploymentGroupRequestMarshaller(); 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("CreateDeploymentGroup").ResponseStructure).Execute(); webResponse.Headers.Add("Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()); UnmarshallerContext context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), false, webResponse); var response = CreateDeploymentGroupResponseUnmarshaller.Instance.Unmarshall(context) as CreateDeploymentGroupResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void CreateDeploymentGroup_AlarmsLimitExceededExceptionMarshallTest() { var operation = service_model.FindOperation("CreateDeploymentGroup"); var request = InstantiateClassGenerator.Execute(); var marshaller = new CreateDeploymentGroupRequestMarshaller(); 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("AlarmsLimitExceededException")); 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","AlarmsLimitExceededException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = CreateDeploymentGroupResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void CreateDeploymentGroup_ApplicationDoesNotExistExceptionMarshallTest() { var operation = service_model.FindOperation("CreateDeploymentGroup"); var request = InstantiateClassGenerator.Execute(); var marshaller = new CreateDeploymentGroupRequestMarshaller(); 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("ApplicationDoesNotExistException")); 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","ApplicationDoesNotExistException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = CreateDeploymentGroupResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void CreateDeploymentGroup_ApplicationNameRequiredExceptionMarshallTest() { var operation = service_model.FindOperation("CreateDeploymentGroup"); var request = InstantiateClassGenerator.Execute(); var marshaller = new CreateDeploymentGroupRequestMarshaller(); 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("ApplicationNameRequiredException")); 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","ApplicationNameRequiredException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = CreateDeploymentGroupResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void CreateDeploymentGroup_DeploymentConfigDoesNotExistExceptionMarshallTest() { var operation = service_model.FindOperation("CreateDeploymentGroup"); var request = InstantiateClassGenerator.Execute(); var marshaller = new CreateDeploymentGroupRequestMarshaller(); 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("DeploymentConfigDoesNotExistException")); 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","DeploymentConfigDoesNotExistException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = CreateDeploymentGroupResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void CreateDeploymentGroup_DeploymentGroupAlreadyExistsExceptionMarshallTest() { var operation = service_model.FindOperation("CreateDeploymentGroup"); var request = InstantiateClassGenerator.Execute(); var marshaller = new CreateDeploymentGroupRequestMarshaller(); 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("DeploymentGroupAlreadyExistsException")); 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","DeploymentGroupAlreadyExistsException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = CreateDeploymentGroupResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void CreateDeploymentGroup_DeploymentGroupLimitExceededExceptionMarshallTest() { var operation = service_model.FindOperation("CreateDeploymentGroup"); var request = InstantiateClassGenerator.Execute(); var marshaller = new CreateDeploymentGroupRequestMarshaller(); 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("DeploymentGroupLimitExceededException")); 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","DeploymentGroupLimitExceededException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = CreateDeploymentGroupResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void CreateDeploymentGroup_DeploymentGroupNameRequiredExceptionMarshallTest() { var operation = service_model.FindOperation("CreateDeploymentGroup"); var request = InstantiateClassGenerator.Execute(); var marshaller = new CreateDeploymentGroupRequestMarshaller(); 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("DeploymentGroupNameRequiredException")); 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","DeploymentGroupNameRequiredException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = CreateDeploymentGroupResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void CreateDeploymentGroup_ECSServiceMappingLimitExceededExceptionMarshallTest() { var operation = service_model.FindOperation("CreateDeploymentGroup"); var request = InstantiateClassGenerator.Execute(); var marshaller = new CreateDeploymentGroupRequestMarshaller(); 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("ECSServiceMappingLimitExceededException")); 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","ECSServiceMappingLimitExceededException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = CreateDeploymentGroupResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void CreateDeploymentGroup_InvalidAlarmConfigExceptionMarshallTest() { var operation = service_model.FindOperation("CreateDeploymentGroup"); var request = InstantiateClassGenerator.Execute(); var marshaller = new CreateDeploymentGroupRequestMarshaller(); 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("InvalidAlarmConfigException")); 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","InvalidAlarmConfigException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = CreateDeploymentGroupResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void CreateDeploymentGroup_InvalidApplicationNameExceptionMarshallTest() { var operation = service_model.FindOperation("CreateDeploymentGroup"); var request = InstantiateClassGenerator.Execute(); var marshaller = new CreateDeploymentGroupRequestMarshaller(); 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("InvalidApplicationNameException")); 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","InvalidApplicationNameException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = CreateDeploymentGroupResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void CreateDeploymentGroup_InvalidAutoRollbackConfigExceptionMarshallTest() { var operation = service_model.FindOperation("CreateDeploymentGroup"); var request = InstantiateClassGenerator.Execute(); var marshaller = new CreateDeploymentGroupRequestMarshaller(); 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("InvalidAutoRollbackConfigException")); 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","InvalidAutoRollbackConfigException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = CreateDeploymentGroupResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void CreateDeploymentGroup_InvalidAutoScalingGroupExceptionMarshallTest() { var operation = service_model.FindOperation("CreateDeploymentGroup"); var request = InstantiateClassGenerator.Execute(); var marshaller = new CreateDeploymentGroupRequestMarshaller(); 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("InvalidAutoScalingGroupException")); 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","InvalidAutoScalingGroupException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = CreateDeploymentGroupResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void CreateDeploymentGroup_InvalidBlueGreenDeploymentConfigurationExceptionMarshallTest() { var operation = service_model.FindOperation("CreateDeploymentGroup"); var request = InstantiateClassGenerator.Execute(); var marshaller = new CreateDeploymentGroupRequestMarshaller(); 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("InvalidBlueGreenDeploymentConfigurationException")); 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","InvalidBlueGreenDeploymentConfigurationException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = CreateDeploymentGroupResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void CreateDeploymentGroup_InvalidDeploymentConfigNameExceptionMarshallTest() { var operation = service_model.FindOperation("CreateDeploymentGroup"); var request = InstantiateClassGenerator.Execute(); var marshaller = new CreateDeploymentGroupRequestMarshaller(); 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("InvalidDeploymentConfigNameException")); 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","InvalidDeploymentConfigNameException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = CreateDeploymentGroupResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void CreateDeploymentGroup_InvalidDeploymentGroupNameExceptionMarshallTest() { var operation = service_model.FindOperation("CreateDeploymentGroup"); var request = InstantiateClassGenerator.Execute(); var marshaller = new CreateDeploymentGroupRequestMarshaller(); 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("InvalidDeploymentGroupNameException")); 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","InvalidDeploymentGroupNameException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = CreateDeploymentGroupResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void CreateDeploymentGroup_InvalidDeploymentStyleExceptionMarshallTest() { var operation = service_model.FindOperation("CreateDeploymentGroup"); var request = InstantiateClassGenerator.Execute(); var marshaller = new CreateDeploymentGroupRequestMarshaller(); 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("InvalidDeploymentStyleException")); 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","InvalidDeploymentStyleException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = CreateDeploymentGroupResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void CreateDeploymentGroup_InvalidEC2TagCombinationExceptionMarshallTest() { var operation = service_model.FindOperation("CreateDeploymentGroup"); var request = InstantiateClassGenerator.Execute(); var marshaller = new CreateDeploymentGroupRequestMarshaller(); 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("InvalidEC2TagCombinationException")); 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","InvalidEC2TagCombinationException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = CreateDeploymentGroupResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void CreateDeploymentGroup_InvalidEC2TagExceptionMarshallTest() { var operation = service_model.FindOperation("CreateDeploymentGroup"); var request = InstantiateClassGenerator.Execute(); var marshaller = new CreateDeploymentGroupRequestMarshaller(); 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("InvalidEC2TagException")); 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","InvalidEC2TagException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = CreateDeploymentGroupResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void CreateDeploymentGroup_InvalidECSServiceExceptionMarshallTest() { var operation = service_model.FindOperation("CreateDeploymentGroup"); var request = InstantiateClassGenerator.Execute(); var marshaller = new CreateDeploymentGroupRequestMarshaller(); 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("InvalidECSServiceException")); 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","InvalidECSServiceException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = CreateDeploymentGroupResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void CreateDeploymentGroup_InvalidInputExceptionMarshallTest() { var operation = service_model.FindOperation("CreateDeploymentGroup"); var request = InstantiateClassGenerator.Execute(); var marshaller = new CreateDeploymentGroupRequestMarshaller(); 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 = CreateDeploymentGroupResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void CreateDeploymentGroup_InvalidLoadBalancerInfoExceptionMarshallTest() { var operation = service_model.FindOperation("CreateDeploymentGroup"); var request = InstantiateClassGenerator.Execute(); var marshaller = new CreateDeploymentGroupRequestMarshaller(); 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("InvalidLoadBalancerInfoException")); 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","InvalidLoadBalancerInfoException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = CreateDeploymentGroupResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void CreateDeploymentGroup_InvalidOnPremisesTagCombinationExceptionMarshallTest() { var operation = service_model.FindOperation("CreateDeploymentGroup"); var request = InstantiateClassGenerator.Execute(); var marshaller = new CreateDeploymentGroupRequestMarshaller(); 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("InvalidOnPremisesTagCombinationException")); 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","InvalidOnPremisesTagCombinationException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = CreateDeploymentGroupResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void CreateDeploymentGroup_InvalidRoleExceptionMarshallTest() { var operation = service_model.FindOperation("CreateDeploymentGroup"); var request = InstantiateClassGenerator.Execute(); var marshaller = new CreateDeploymentGroupRequestMarshaller(); 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("InvalidRoleException")); 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","InvalidRoleException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = CreateDeploymentGroupResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void CreateDeploymentGroup_InvalidTagExceptionMarshallTest() { var operation = service_model.FindOperation("CreateDeploymentGroup"); var request = InstantiateClassGenerator.Execute(); var marshaller = new CreateDeploymentGroupRequestMarshaller(); 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("InvalidTagException")); 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","InvalidTagException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = CreateDeploymentGroupResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void CreateDeploymentGroup_InvalidTagsToAddExceptionMarshallTest() { var operation = service_model.FindOperation("CreateDeploymentGroup"); var request = InstantiateClassGenerator.Execute(); var marshaller = new CreateDeploymentGroupRequestMarshaller(); 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("InvalidTagsToAddException")); 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","InvalidTagsToAddException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = CreateDeploymentGroupResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void CreateDeploymentGroup_InvalidTargetGroupPairExceptionMarshallTest() { var operation = service_model.FindOperation("CreateDeploymentGroup"); var request = InstantiateClassGenerator.Execute(); var marshaller = new CreateDeploymentGroupRequestMarshaller(); 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("InvalidTargetGroupPairException")); 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","InvalidTargetGroupPairException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = CreateDeploymentGroupResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void CreateDeploymentGroup_InvalidTrafficRoutingConfigurationExceptionMarshallTest() { var operation = service_model.FindOperation("CreateDeploymentGroup"); var request = InstantiateClassGenerator.Execute(); var marshaller = new CreateDeploymentGroupRequestMarshaller(); 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("InvalidTrafficRoutingConfigurationException")); 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","InvalidTrafficRoutingConfigurationException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = CreateDeploymentGroupResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void CreateDeploymentGroup_InvalidTriggerConfigExceptionMarshallTest() { var operation = service_model.FindOperation("CreateDeploymentGroup"); var request = InstantiateClassGenerator.Execute(); var marshaller = new CreateDeploymentGroupRequestMarshaller(); 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("InvalidTriggerConfigException")); 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","InvalidTriggerConfigException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = CreateDeploymentGroupResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void CreateDeploymentGroup_LifecycleHookLimitExceededExceptionMarshallTest() { var operation = service_model.FindOperation("CreateDeploymentGroup"); var request = InstantiateClassGenerator.Execute(); var marshaller = new CreateDeploymentGroupRequestMarshaller(); 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("LifecycleHookLimitExceededException")); 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","LifecycleHookLimitExceededException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = CreateDeploymentGroupResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void CreateDeploymentGroup_RoleRequiredExceptionMarshallTest() { var operation = service_model.FindOperation("CreateDeploymentGroup"); var request = InstantiateClassGenerator.Execute(); var marshaller = new CreateDeploymentGroupRequestMarshaller(); 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("RoleRequiredException")); 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","RoleRequiredException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = CreateDeploymentGroupResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void CreateDeploymentGroup_TagSetListLimitExceededExceptionMarshallTest() { var operation = service_model.FindOperation("CreateDeploymentGroup"); var request = InstantiateClassGenerator.Execute(); var marshaller = new CreateDeploymentGroupRequestMarshaller(); 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("TagSetListLimitExceededException")); 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","TagSetListLimitExceededException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = CreateDeploymentGroupResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void CreateDeploymentGroup_ThrottlingExceptionMarshallTest() { var operation = service_model.FindOperation("CreateDeploymentGroup"); var request = InstantiateClassGenerator.Execute(); var marshaller = new CreateDeploymentGroupRequestMarshaller(); 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("ThrottlingException")); 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","ThrottlingException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = CreateDeploymentGroupResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void CreateDeploymentGroup_TriggerTargetsLimitExceededExceptionMarshallTest() { var operation = service_model.FindOperation("CreateDeploymentGroup"); var request = InstantiateClassGenerator.Execute(); var marshaller = new CreateDeploymentGroupRequestMarshaller(); 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("TriggerTargetsLimitExceededException")); 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","TriggerTargetsLimitExceededException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = CreateDeploymentGroupResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void DeleteApplicationMarshallTest() { var request = InstantiateClassGenerator.Execute(); var marshaller = new DeleteApplicationRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void DeleteApplication_ApplicationNameRequiredExceptionMarshallTest() { var operation = service_model.FindOperation("DeleteApplication"); var request = InstantiateClassGenerator.Execute(); var marshaller = new DeleteApplicationRequestMarshaller(); 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("ApplicationNameRequiredException")); 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","ApplicationNameRequiredException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = DeleteApplicationResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void DeleteApplication_InvalidApplicationNameExceptionMarshallTest() { var operation = service_model.FindOperation("DeleteApplication"); var request = InstantiateClassGenerator.Execute(); var marshaller = new DeleteApplicationRequestMarshaller(); 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("InvalidApplicationNameException")); 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","InvalidApplicationNameException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = DeleteApplicationResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void DeleteApplication_InvalidRoleExceptionMarshallTest() { var operation = service_model.FindOperation("DeleteApplication"); var request = InstantiateClassGenerator.Execute(); var marshaller = new DeleteApplicationRequestMarshaller(); 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("InvalidRoleException")); 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","InvalidRoleException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = DeleteApplicationResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void DeleteDeploymentConfigMarshallTest() { var request = InstantiateClassGenerator.Execute(); var marshaller = new DeleteDeploymentConfigRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void DeleteDeploymentConfig_DeploymentConfigInUseExceptionMarshallTest() { var operation = service_model.FindOperation("DeleteDeploymentConfig"); var request = InstantiateClassGenerator.Execute(); var marshaller = new DeleteDeploymentConfigRequestMarshaller(); 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("DeploymentConfigInUseException")); 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","DeploymentConfigInUseException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = DeleteDeploymentConfigResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void DeleteDeploymentConfig_DeploymentConfigNameRequiredExceptionMarshallTest() { var operation = service_model.FindOperation("DeleteDeploymentConfig"); var request = InstantiateClassGenerator.Execute(); var marshaller = new DeleteDeploymentConfigRequestMarshaller(); 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("DeploymentConfigNameRequiredException")); 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","DeploymentConfigNameRequiredException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = DeleteDeploymentConfigResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void DeleteDeploymentConfig_InvalidDeploymentConfigNameExceptionMarshallTest() { var operation = service_model.FindOperation("DeleteDeploymentConfig"); var request = InstantiateClassGenerator.Execute(); var marshaller = new DeleteDeploymentConfigRequestMarshaller(); 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("InvalidDeploymentConfigNameException")); 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","InvalidDeploymentConfigNameException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = DeleteDeploymentConfigResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void DeleteDeploymentConfig_InvalidOperationExceptionMarshallTest() { var operation = service_model.FindOperation("DeleteDeploymentConfig"); var request = InstantiateClassGenerator.Execute(); var marshaller = new DeleteDeploymentConfigRequestMarshaller(); 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("InvalidOperationException")); 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","InvalidOperationException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = DeleteDeploymentConfigResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void DeleteDeploymentGroupMarshallTest() { var request = InstantiateClassGenerator.Execute(); var marshaller = new DeleteDeploymentGroupRequestMarshaller(); 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("DeleteDeploymentGroup").ResponseStructure).Execute(); webResponse.Headers.Add("Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()); UnmarshallerContext context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), false, webResponse); var response = DeleteDeploymentGroupResponseUnmarshaller.Instance.Unmarshall(context) as DeleteDeploymentGroupResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void DeleteDeploymentGroup_ApplicationNameRequiredExceptionMarshallTest() { var operation = service_model.FindOperation("DeleteDeploymentGroup"); var request = InstantiateClassGenerator.Execute(); var marshaller = new DeleteDeploymentGroupRequestMarshaller(); 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("ApplicationNameRequiredException")); 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","ApplicationNameRequiredException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = DeleteDeploymentGroupResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void DeleteDeploymentGroup_DeploymentGroupNameRequiredExceptionMarshallTest() { var operation = service_model.FindOperation("DeleteDeploymentGroup"); var request = InstantiateClassGenerator.Execute(); var marshaller = new DeleteDeploymentGroupRequestMarshaller(); 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("DeploymentGroupNameRequiredException")); 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","DeploymentGroupNameRequiredException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = DeleteDeploymentGroupResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void DeleteDeploymentGroup_InvalidApplicationNameExceptionMarshallTest() { var operation = service_model.FindOperation("DeleteDeploymentGroup"); var request = InstantiateClassGenerator.Execute(); var marshaller = new DeleteDeploymentGroupRequestMarshaller(); 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("InvalidApplicationNameException")); 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","InvalidApplicationNameException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = DeleteDeploymentGroupResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void DeleteDeploymentGroup_InvalidDeploymentGroupNameExceptionMarshallTest() { var operation = service_model.FindOperation("DeleteDeploymentGroup"); var request = InstantiateClassGenerator.Execute(); var marshaller = new DeleteDeploymentGroupRequestMarshaller(); 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("InvalidDeploymentGroupNameException")); 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","InvalidDeploymentGroupNameException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = DeleteDeploymentGroupResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void DeleteDeploymentGroup_InvalidRoleExceptionMarshallTest() { var operation = service_model.FindOperation("DeleteDeploymentGroup"); var request = InstantiateClassGenerator.Execute(); var marshaller = new DeleteDeploymentGroupRequestMarshaller(); 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("InvalidRoleException")); 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","InvalidRoleException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = DeleteDeploymentGroupResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void DeleteGitHubAccountTokenMarshallTest() { var request = InstantiateClassGenerator.Execute(); var marshaller = new DeleteGitHubAccountTokenRequestMarshaller(); 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("DeleteGitHubAccountToken").ResponseStructure).Execute(); webResponse.Headers.Add("Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()); UnmarshallerContext context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), false, webResponse); var response = DeleteGitHubAccountTokenResponseUnmarshaller.Instance.Unmarshall(context) as DeleteGitHubAccountTokenResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void DeleteGitHubAccountToken_GitHubAccountTokenDoesNotExistExceptionMarshallTest() { var operation = service_model.FindOperation("DeleteGitHubAccountToken"); var request = InstantiateClassGenerator.Execute(); var marshaller = new DeleteGitHubAccountTokenRequestMarshaller(); 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("GitHubAccountTokenDoesNotExistException")); 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","GitHubAccountTokenDoesNotExistException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = DeleteGitHubAccountTokenResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void DeleteGitHubAccountToken_GitHubAccountTokenNameRequiredExceptionMarshallTest() { var operation = service_model.FindOperation("DeleteGitHubAccountToken"); var request = InstantiateClassGenerator.Execute(); var marshaller = new DeleteGitHubAccountTokenRequestMarshaller(); 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("GitHubAccountTokenNameRequiredException")); 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","GitHubAccountTokenNameRequiredException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = DeleteGitHubAccountTokenResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void DeleteGitHubAccountToken_InvalidGitHubAccountTokenNameExceptionMarshallTest() { var operation = service_model.FindOperation("DeleteGitHubAccountToken"); var request = InstantiateClassGenerator.Execute(); var marshaller = new DeleteGitHubAccountTokenRequestMarshaller(); 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("InvalidGitHubAccountTokenNameException")); 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","InvalidGitHubAccountTokenNameException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = DeleteGitHubAccountTokenResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void DeleteGitHubAccountToken_OperationNotSupportedExceptionMarshallTest() { var operation = service_model.FindOperation("DeleteGitHubAccountToken"); var request = InstantiateClassGenerator.Execute(); var marshaller = new DeleteGitHubAccountTokenRequestMarshaller(); 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("OperationNotSupportedException")); 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","OperationNotSupportedException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = DeleteGitHubAccountTokenResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void DeleteGitHubAccountToken_ResourceValidationExceptionMarshallTest() { var operation = service_model.FindOperation("DeleteGitHubAccountToken"); var request = InstantiateClassGenerator.Execute(); var marshaller = new DeleteGitHubAccountTokenRequestMarshaller(); 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("ResourceValidationException")); 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","ResourceValidationException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = DeleteGitHubAccountTokenResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void DeleteResourcesByExternalIdMarshallTest() { var request = InstantiateClassGenerator.Execute(); var marshaller = new DeleteResourcesByExternalIdRequestMarshaller(); 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("DeleteResourcesByExternalId").ResponseStructure).Execute(); webResponse.Headers.Add("Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()); UnmarshallerContext context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), false, webResponse); var response = DeleteResourcesByExternalIdResponseUnmarshaller.Instance.Unmarshall(context) as DeleteResourcesByExternalIdResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void DeregisterOnPremisesInstanceMarshallTest() { var request = InstantiateClassGenerator.Execute(); var marshaller = new DeregisterOnPremisesInstanceRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void DeregisterOnPremisesInstance_InstanceNameRequiredExceptionMarshallTest() { var operation = service_model.FindOperation("DeregisterOnPremisesInstance"); var request = InstantiateClassGenerator.Execute(); var marshaller = new DeregisterOnPremisesInstanceRequestMarshaller(); 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("InstanceNameRequiredException")); 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","InstanceNameRequiredException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = DeregisterOnPremisesInstanceResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void DeregisterOnPremisesInstance_InvalidInstanceNameExceptionMarshallTest() { var operation = service_model.FindOperation("DeregisterOnPremisesInstance"); var request = InstantiateClassGenerator.Execute(); var marshaller = new DeregisterOnPremisesInstanceRequestMarshaller(); 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("InvalidInstanceNameException")); 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","InvalidInstanceNameException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = DeregisterOnPremisesInstanceResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void GetApplicationMarshallTest() { var request = InstantiateClassGenerator.Execute(); var marshaller = new GetApplicationRequestMarshaller(); 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("GetApplication").ResponseStructure).Execute(); webResponse.Headers.Add("Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()); UnmarshallerContext context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), false, webResponse); var response = GetApplicationResponseUnmarshaller.Instance.Unmarshall(context) as GetApplicationResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void GetApplication_ApplicationDoesNotExistExceptionMarshallTest() { var operation = service_model.FindOperation("GetApplication"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetApplicationRequestMarshaller(); 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("ApplicationDoesNotExistException")); 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","ApplicationDoesNotExistException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = GetApplicationResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void GetApplication_ApplicationNameRequiredExceptionMarshallTest() { var operation = service_model.FindOperation("GetApplication"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetApplicationRequestMarshaller(); 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("ApplicationNameRequiredException")); 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","ApplicationNameRequiredException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = GetApplicationResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void GetApplication_InvalidApplicationNameExceptionMarshallTest() { var operation = service_model.FindOperation("GetApplication"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetApplicationRequestMarshaller(); 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("InvalidApplicationNameException")); 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","InvalidApplicationNameException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = GetApplicationResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void GetApplicationRevisionMarshallTest() { var request = InstantiateClassGenerator.Execute(); var marshaller = new GetApplicationRevisionRequestMarshaller(); 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("GetApplicationRevision").ResponseStructure).Execute(); webResponse.Headers.Add("Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()); UnmarshallerContext context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), false, webResponse); var response = GetApplicationRevisionResponseUnmarshaller.Instance.Unmarshall(context) as GetApplicationRevisionResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void GetApplicationRevision_ApplicationDoesNotExistExceptionMarshallTest() { var operation = service_model.FindOperation("GetApplicationRevision"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetApplicationRevisionRequestMarshaller(); 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("ApplicationDoesNotExistException")); 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","ApplicationDoesNotExistException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = GetApplicationRevisionResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void GetApplicationRevision_ApplicationNameRequiredExceptionMarshallTest() { var operation = service_model.FindOperation("GetApplicationRevision"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetApplicationRevisionRequestMarshaller(); 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("ApplicationNameRequiredException")); 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","ApplicationNameRequiredException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = GetApplicationRevisionResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void GetApplicationRevision_InvalidApplicationNameExceptionMarshallTest() { var operation = service_model.FindOperation("GetApplicationRevision"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetApplicationRevisionRequestMarshaller(); 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("InvalidApplicationNameException")); 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","InvalidApplicationNameException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = GetApplicationRevisionResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void GetApplicationRevision_InvalidRevisionExceptionMarshallTest() { var operation = service_model.FindOperation("GetApplicationRevision"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetApplicationRevisionRequestMarshaller(); 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("InvalidRevisionException")); 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","InvalidRevisionException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = GetApplicationRevisionResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void GetApplicationRevision_RevisionDoesNotExistExceptionMarshallTest() { var operation = service_model.FindOperation("GetApplicationRevision"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetApplicationRevisionRequestMarshaller(); 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("RevisionDoesNotExistException")); 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","RevisionDoesNotExistException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = GetApplicationRevisionResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void GetApplicationRevision_RevisionRequiredExceptionMarshallTest() { var operation = service_model.FindOperation("GetApplicationRevision"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetApplicationRevisionRequestMarshaller(); 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("RevisionRequiredException")); 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","RevisionRequiredException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = GetApplicationRevisionResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void GetDeploymentMarshallTest() { var request = InstantiateClassGenerator.Execute(); var marshaller = new GetDeploymentRequestMarshaller(); 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("GetDeployment").ResponseStructure).Execute(); webResponse.Headers.Add("Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()); UnmarshallerContext context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), false, webResponse); var response = GetDeploymentResponseUnmarshaller.Instance.Unmarshall(context) as GetDeploymentResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void GetDeployment_DeploymentDoesNotExistExceptionMarshallTest() { var operation = service_model.FindOperation("GetDeployment"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetDeploymentRequestMarshaller(); 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("DeploymentDoesNotExistException")); 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","DeploymentDoesNotExistException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = GetDeploymentResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void GetDeployment_DeploymentIdRequiredExceptionMarshallTest() { var operation = service_model.FindOperation("GetDeployment"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetDeploymentRequestMarshaller(); 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("DeploymentIdRequiredException")); 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","DeploymentIdRequiredException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = GetDeploymentResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void GetDeployment_InvalidDeploymentIdExceptionMarshallTest() { var operation = service_model.FindOperation("GetDeployment"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetDeploymentRequestMarshaller(); 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("InvalidDeploymentIdException")); 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","InvalidDeploymentIdException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = GetDeploymentResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void GetDeploymentConfigMarshallTest() { var request = InstantiateClassGenerator.Execute(); var marshaller = new GetDeploymentConfigRequestMarshaller(); 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("GetDeploymentConfig").ResponseStructure).Execute(); webResponse.Headers.Add("Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()); UnmarshallerContext context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), false, webResponse); var response = GetDeploymentConfigResponseUnmarshaller.Instance.Unmarshall(context) as GetDeploymentConfigResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void GetDeploymentConfig_DeploymentConfigDoesNotExistExceptionMarshallTest() { var operation = service_model.FindOperation("GetDeploymentConfig"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetDeploymentConfigRequestMarshaller(); 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("DeploymentConfigDoesNotExistException")); 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","DeploymentConfigDoesNotExistException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = GetDeploymentConfigResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void GetDeploymentConfig_DeploymentConfigNameRequiredExceptionMarshallTest() { var operation = service_model.FindOperation("GetDeploymentConfig"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetDeploymentConfigRequestMarshaller(); 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("DeploymentConfigNameRequiredException")); 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","DeploymentConfigNameRequiredException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = GetDeploymentConfigResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void GetDeploymentConfig_InvalidComputePlatformExceptionMarshallTest() { var operation = service_model.FindOperation("GetDeploymentConfig"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetDeploymentConfigRequestMarshaller(); 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("InvalidComputePlatformException")); 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","InvalidComputePlatformException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = GetDeploymentConfigResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void GetDeploymentConfig_InvalidDeploymentConfigNameExceptionMarshallTest() { var operation = service_model.FindOperation("GetDeploymentConfig"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetDeploymentConfigRequestMarshaller(); 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("InvalidDeploymentConfigNameException")); 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","InvalidDeploymentConfigNameException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = GetDeploymentConfigResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void GetDeploymentGroupMarshallTest() { var request = InstantiateClassGenerator.Execute(); var marshaller = new GetDeploymentGroupRequestMarshaller(); 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("GetDeploymentGroup").ResponseStructure).Execute(); webResponse.Headers.Add("Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()); UnmarshallerContext context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), false, webResponse); var response = GetDeploymentGroupResponseUnmarshaller.Instance.Unmarshall(context) as GetDeploymentGroupResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void GetDeploymentGroup_ApplicationDoesNotExistExceptionMarshallTest() { var operation = service_model.FindOperation("GetDeploymentGroup"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetDeploymentGroupRequestMarshaller(); 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("ApplicationDoesNotExistException")); 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","ApplicationDoesNotExistException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = GetDeploymentGroupResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void GetDeploymentGroup_ApplicationNameRequiredExceptionMarshallTest() { var operation = service_model.FindOperation("GetDeploymentGroup"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetDeploymentGroupRequestMarshaller(); 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("ApplicationNameRequiredException")); 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","ApplicationNameRequiredException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = GetDeploymentGroupResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void GetDeploymentGroup_DeploymentConfigDoesNotExistExceptionMarshallTest() { var operation = service_model.FindOperation("GetDeploymentGroup"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetDeploymentGroupRequestMarshaller(); 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("DeploymentConfigDoesNotExistException")); 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","DeploymentConfigDoesNotExistException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = GetDeploymentGroupResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void GetDeploymentGroup_DeploymentGroupDoesNotExistExceptionMarshallTest() { var operation = service_model.FindOperation("GetDeploymentGroup"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetDeploymentGroupRequestMarshaller(); 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("DeploymentGroupDoesNotExistException")); 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","DeploymentGroupDoesNotExistException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = GetDeploymentGroupResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void GetDeploymentGroup_DeploymentGroupNameRequiredExceptionMarshallTest() { var operation = service_model.FindOperation("GetDeploymentGroup"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetDeploymentGroupRequestMarshaller(); 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("DeploymentGroupNameRequiredException")); 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","DeploymentGroupNameRequiredException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = GetDeploymentGroupResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void GetDeploymentGroup_InvalidApplicationNameExceptionMarshallTest() { var operation = service_model.FindOperation("GetDeploymentGroup"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetDeploymentGroupRequestMarshaller(); 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("InvalidApplicationNameException")); 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","InvalidApplicationNameException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = GetDeploymentGroupResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void GetDeploymentGroup_InvalidDeploymentGroupNameExceptionMarshallTest() { var operation = service_model.FindOperation("GetDeploymentGroup"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetDeploymentGroupRequestMarshaller(); 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("InvalidDeploymentGroupNameException")); 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","InvalidDeploymentGroupNameException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = GetDeploymentGroupResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void GetDeploymentInstanceMarshallTest() { var request = InstantiateClassGenerator.Execute(); var marshaller = new GetDeploymentInstanceRequestMarshaller(); 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("GetDeploymentInstance").ResponseStructure).Execute(); webResponse.Headers.Add("Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()); UnmarshallerContext context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), false, webResponse); var response = GetDeploymentInstanceResponseUnmarshaller.Instance.Unmarshall(context) as GetDeploymentInstanceResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void GetDeploymentInstance_DeploymentDoesNotExistExceptionMarshallTest() { var operation = service_model.FindOperation("GetDeploymentInstance"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetDeploymentInstanceRequestMarshaller(); 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("DeploymentDoesNotExistException")); 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","DeploymentDoesNotExistException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = GetDeploymentInstanceResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void GetDeploymentInstance_DeploymentIdRequiredExceptionMarshallTest() { var operation = service_model.FindOperation("GetDeploymentInstance"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetDeploymentInstanceRequestMarshaller(); 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("DeploymentIdRequiredException")); 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","DeploymentIdRequiredException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = GetDeploymentInstanceResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void GetDeploymentInstance_InstanceDoesNotExistExceptionMarshallTest() { var operation = service_model.FindOperation("GetDeploymentInstance"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetDeploymentInstanceRequestMarshaller(); 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("InstanceDoesNotExistException")); 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","InstanceDoesNotExistException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = GetDeploymentInstanceResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void GetDeploymentInstance_InstanceIdRequiredExceptionMarshallTest() { var operation = service_model.FindOperation("GetDeploymentInstance"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetDeploymentInstanceRequestMarshaller(); 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("InstanceIdRequiredException")); 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","InstanceIdRequiredException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = GetDeploymentInstanceResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void GetDeploymentInstance_InvalidComputePlatformExceptionMarshallTest() { var operation = service_model.FindOperation("GetDeploymentInstance"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetDeploymentInstanceRequestMarshaller(); 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("InvalidComputePlatformException")); 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","InvalidComputePlatformException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = GetDeploymentInstanceResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void GetDeploymentInstance_InvalidDeploymentIdExceptionMarshallTest() { var operation = service_model.FindOperation("GetDeploymentInstance"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetDeploymentInstanceRequestMarshaller(); 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("InvalidDeploymentIdException")); 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","InvalidDeploymentIdException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = GetDeploymentInstanceResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void GetDeploymentInstance_InvalidInstanceNameExceptionMarshallTest() { var operation = service_model.FindOperation("GetDeploymentInstance"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetDeploymentInstanceRequestMarshaller(); 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("InvalidInstanceNameException")); 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","InvalidInstanceNameException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = GetDeploymentInstanceResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void GetDeploymentTargetMarshallTest() { var request = InstantiateClassGenerator.Execute(); var marshaller = new GetDeploymentTargetRequestMarshaller(); 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("GetDeploymentTarget").ResponseStructure).Execute(); webResponse.Headers.Add("Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()); UnmarshallerContext context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), false, webResponse); var response = GetDeploymentTargetResponseUnmarshaller.Instance.Unmarshall(context) as GetDeploymentTargetResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void GetDeploymentTarget_DeploymentDoesNotExistExceptionMarshallTest() { var operation = service_model.FindOperation("GetDeploymentTarget"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetDeploymentTargetRequestMarshaller(); 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("DeploymentDoesNotExistException")); 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","DeploymentDoesNotExistException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = GetDeploymentTargetResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void GetDeploymentTarget_DeploymentIdRequiredExceptionMarshallTest() { var operation = service_model.FindOperation("GetDeploymentTarget"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetDeploymentTargetRequestMarshaller(); 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("DeploymentIdRequiredException")); 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","DeploymentIdRequiredException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = GetDeploymentTargetResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void GetDeploymentTarget_DeploymentNotStartedExceptionMarshallTest() { var operation = service_model.FindOperation("GetDeploymentTarget"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetDeploymentTargetRequestMarshaller(); 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("DeploymentNotStartedException")); 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","DeploymentNotStartedException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = GetDeploymentTargetResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void GetDeploymentTarget_DeploymentTargetDoesNotExistExceptionMarshallTest() { var operation = service_model.FindOperation("GetDeploymentTarget"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetDeploymentTargetRequestMarshaller(); 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("DeploymentTargetDoesNotExistException")); 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","DeploymentTargetDoesNotExistException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = GetDeploymentTargetResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void GetDeploymentTarget_DeploymentTargetIdRequiredExceptionMarshallTest() { var operation = service_model.FindOperation("GetDeploymentTarget"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetDeploymentTargetRequestMarshaller(); 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("DeploymentTargetIdRequiredException")); 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","DeploymentTargetIdRequiredException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = GetDeploymentTargetResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void GetDeploymentTarget_InvalidDeploymentIdExceptionMarshallTest() { var operation = service_model.FindOperation("GetDeploymentTarget"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetDeploymentTargetRequestMarshaller(); 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("InvalidDeploymentIdException")); 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","InvalidDeploymentIdException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = GetDeploymentTargetResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void GetDeploymentTarget_InvalidDeploymentTargetIdExceptionMarshallTest() { var operation = service_model.FindOperation("GetDeploymentTarget"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetDeploymentTargetRequestMarshaller(); 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("InvalidDeploymentTargetIdException")); 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","InvalidDeploymentTargetIdException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = GetDeploymentTargetResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void GetDeploymentTarget_InvalidInstanceNameExceptionMarshallTest() { var operation = service_model.FindOperation("GetDeploymentTarget"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetDeploymentTargetRequestMarshaller(); 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("InvalidInstanceNameException")); 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","InvalidInstanceNameException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = GetDeploymentTargetResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void GetOnPremisesInstanceMarshallTest() { var request = InstantiateClassGenerator.Execute(); var marshaller = new GetOnPremisesInstanceRequestMarshaller(); 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("GetOnPremisesInstance").ResponseStructure).Execute(); webResponse.Headers.Add("Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()); UnmarshallerContext context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), false, webResponse); var response = GetOnPremisesInstanceResponseUnmarshaller.Instance.Unmarshall(context) as GetOnPremisesInstanceResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void GetOnPremisesInstance_InstanceNameRequiredExceptionMarshallTest() { var operation = service_model.FindOperation("GetOnPremisesInstance"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetOnPremisesInstanceRequestMarshaller(); 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("InstanceNameRequiredException")); 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","InstanceNameRequiredException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = GetOnPremisesInstanceResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void GetOnPremisesInstance_InstanceNotRegisteredExceptionMarshallTest() { var operation = service_model.FindOperation("GetOnPremisesInstance"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetOnPremisesInstanceRequestMarshaller(); 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("InstanceNotRegisteredException")); 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","InstanceNotRegisteredException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = GetOnPremisesInstanceResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void GetOnPremisesInstance_InvalidInstanceNameExceptionMarshallTest() { var operation = service_model.FindOperation("GetOnPremisesInstance"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetOnPremisesInstanceRequestMarshaller(); 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("InvalidInstanceNameException")); 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","InvalidInstanceNameException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = GetOnPremisesInstanceResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void ListApplicationRevisionsMarshallTest() { var request = InstantiateClassGenerator.Execute(); var marshaller = new ListApplicationRevisionsRequestMarshaller(); 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("ListApplicationRevisions").ResponseStructure).Execute(); webResponse.Headers.Add("Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()); UnmarshallerContext context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), false, webResponse); var response = ListApplicationRevisionsResponseUnmarshaller.Instance.Unmarshall(context) as ListApplicationRevisionsResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void ListApplicationRevisions_ApplicationDoesNotExistExceptionMarshallTest() { var operation = service_model.FindOperation("ListApplicationRevisions"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListApplicationRevisionsRequestMarshaller(); 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("ApplicationDoesNotExistException")); 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","ApplicationDoesNotExistException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = ListApplicationRevisionsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void ListApplicationRevisions_ApplicationNameRequiredExceptionMarshallTest() { var operation = service_model.FindOperation("ListApplicationRevisions"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListApplicationRevisionsRequestMarshaller(); 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("ApplicationNameRequiredException")); 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","ApplicationNameRequiredException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = ListApplicationRevisionsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void ListApplicationRevisions_BucketNameFilterRequiredExceptionMarshallTest() { var operation = service_model.FindOperation("ListApplicationRevisions"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListApplicationRevisionsRequestMarshaller(); 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("BucketNameFilterRequiredException")); 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","BucketNameFilterRequiredException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = ListApplicationRevisionsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void ListApplicationRevisions_InvalidApplicationNameExceptionMarshallTest() { var operation = service_model.FindOperation("ListApplicationRevisions"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListApplicationRevisionsRequestMarshaller(); 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("InvalidApplicationNameException")); 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","InvalidApplicationNameException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = ListApplicationRevisionsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void ListApplicationRevisions_InvalidBucketNameFilterExceptionMarshallTest() { var operation = service_model.FindOperation("ListApplicationRevisions"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListApplicationRevisionsRequestMarshaller(); 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("InvalidBucketNameFilterException")); 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","InvalidBucketNameFilterException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = ListApplicationRevisionsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void ListApplicationRevisions_InvalidDeployedStateFilterExceptionMarshallTest() { var operation = service_model.FindOperation("ListApplicationRevisions"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListApplicationRevisionsRequestMarshaller(); 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("InvalidDeployedStateFilterException")); 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","InvalidDeployedStateFilterException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = ListApplicationRevisionsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void ListApplicationRevisions_InvalidKeyPrefixFilterExceptionMarshallTest() { var operation = service_model.FindOperation("ListApplicationRevisions"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListApplicationRevisionsRequestMarshaller(); 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("InvalidKeyPrefixFilterException")); 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","InvalidKeyPrefixFilterException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = ListApplicationRevisionsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void ListApplicationRevisions_InvalidNextTokenExceptionMarshallTest() { var operation = service_model.FindOperation("ListApplicationRevisions"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListApplicationRevisionsRequestMarshaller(); 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("InvalidNextTokenException")); 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","InvalidNextTokenException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = ListApplicationRevisionsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void ListApplicationRevisions_InvalidSortByExceptionMarshallTest() { var operation = service_model.FindOperation("ListApplicationRevisions"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListApplicationRevisionsRequestMarshaller(); 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("InvalidSortByException")); 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","InvalidSortByException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = ListApplicationRevisionsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void ListApplicationRevisions_InvalidSortOrderExceptionMarshallTest() { var operation = service_model.FindOperation("ListApplicationRevisions"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListApplicationRevisionsRequestMarshaller(); 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("InvalidSortOrderException")); 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","InvalidSortOrderException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = ListApplicationRevisionsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void ListApplicationsMarshallTest() { var request = InstantiateClassGenerator.Execute(); var marshaller = new ListApplicationsRequestMarshaller(); 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("ListApplications").ResponseStructure).Execute(); webResponse.Headers.Add("Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()); UnmarshallerContext context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), false, webResponse); var response = ListApplicationsResponseUnmarshaller.Instance.Unmarshall(context) as ListApplicationsResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void ListApplications_InvalidNextTokenExceptionMarshallTest() { var operation = service_model.FindOperation("ListApplications"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListApplicationsRequestMarshaller(); 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("InvalidNextTokenException")); 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","InvalidNextTokenException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = ListApplicationsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void ListDeploymentConfigsMarshallTest() { var request = InstantiateClassGenerator.Execute(); var marshaller = new ListDeploymentConfigsRequestMarshaller(); 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("ListDeploymentConfigs").ResponseStructure).Execute(); webResponse.Headers.Add("Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()); UnmarshallerContext context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), false, webResponse); var response = ListDeploymentConfigsResponseUnmarshaller.Instance.Unmarshall(context) as ListDeploymentConfigsResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void ListDeploymentConfigs_InvalidNextTokenExceptionMarshallTest() { var operation = service_model.FindOperation("ListDeploymentConfigs"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListDeploymentConfigsRequestMarshaller(); 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("InvalidNextTokenException")); 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","InvalidNextTokenException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = ListDeploymentConfigsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void ListDeploymentGroupsMarshallTest() { var request = InstantiateClassGenerator.Execute(); var marshaller = new ListDeploymentGroupsRequestMarshaller(); 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("ListDeploymentGroups").ResponseStructure).Execute(); webResponse.Headers.Add("Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()); UnmarshallerContext context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), false, webResponse); var response = ListDeploymentGroupsResponseUnmarshaller.Instance.Unmarshall(context) as ListDeploymentGroupsResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void ListDeploymentGroups_ApplicationDoesNotExistExceptionMarshallTest() { var operation = service_model.FindOperation("ListDeploymentGroups"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListDeploymentGroupsRequestMarshaller(); 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("ApplicationDoesNotExistException")); 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","ApplicationDoesNotExistException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = ListDeploymentGroupsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void ListDeploymentGroups_ApplicationNameRequiredExceptionMarshallTest() { var operation = service_model.FindOperation("ListDeploymentGroups"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListDeploymentGroupsRequestMarshaller(); 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("ApplicationNameRequiredException")); 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","ApplicationNameRequiredException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = ListDeploymentGroupsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void ListDeploymentGroups_InvalidApplicationNameExceptionMarshallTest() { var operation = service_model.FindOperation("ListDeploymentGroups"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListDeploymentGroupsRequestMarshaller(); 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("InvalidApplicationNameException")); 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","InvalidApplicationNameException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = ListDeploymentGroupsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void ListDeploymentGroups_InvalidNextTokenExceptionMarshallTest() { var operation = service_model.FindOperation("ListDeploymentGroups"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListDeploymentGroupsRequestMarshaller(); 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("InvalidNextTokenException")); 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","InvalidNextTokenException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = ListDeploymentGroupsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void ListDeploymentInstancesMarshallTest() { var request = InstantiateClassGenerator.Execute(); var marshaller = new ListDeploymentInstancesRequestMarshaller(); 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("ListDeploymentInstances").ResponseStructure).Execute(); webResponse.Headers.Add("Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()); UnmarshallerContext context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), false, webResponse); var response = ListDeploymentInstancesResponseUnmarshaller.Instance.Unmarshall(context) as ListDeploymentInstancesResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void ListDeploymentInstances_DeploymentDoesNotExistExceptionMarshallTest() { var operation = service_model.FindOperation("ListDeploymentInstances"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListDeploymentInstancesRequestMarshaller(); 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("DeploymentDoesNotExistException")); 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","DeploymentDoesNotExistException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = ListDeploymentInstancesResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void ListDeploymentInstances_DeploymentIdRequiredExceptionMarshallTest() { var operation = service_model.FindOperation("ListDeploymentInstances"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListDeploymentInstancesRequestMarshaller(); 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("DeploymentIdRequiredException")); 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","DeploymentIdRequiredException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = ListDeploymentInstancesResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void ListDeploymentInstances_DeploymentNotStartedExceptionMarshallTest() { var operation = service_model.FindOperation("ListDeploymentInstances"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListDeploymentInstancesRequestMarshaller(); 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("DeploymentNotStartedException")); 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","DeploymentNotStartedException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = ListDeploymentInstancesResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void ListDeploymentInstances_InvalidComputePlatformExceptionMarshallTest() { var operation = service_model.FindOperation("ListDeploymentInstances"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListDeploymentInstancesRequestMarshaller(); 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("InvalidComputePlatformException")); 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","InvalidComputePlatformException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = ListDeploymentInstancesResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void ListDeploymentInstances_InvalidDeploymentIdExceptionMarshallTest() { var operation = service_model.FindOperation("ListDeploymentInstances"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListDeploymentInstancesRequestMarshaller(); 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("InvalidDeploymentIdException")); 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","InvalidDeploymentIdException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = ListDeploymentInstancesResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void ListDeploymentInstances_InvalidDeploymentInstanceTypeExceptionMarshallTest() { var operation = service_model.FindOperation("ListDeploymentInstances"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListDeploymentInstancesRequestMarshaller(); 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("InvalidDeploymentInstanceTypeException")); 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","InvalidDeploymentInstanceTypeException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = ListDeploymentInstancesResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void ListDeploymentInstances_InvalidInstanceStatusExceptionMarshallTest() { var operation = service_model.FindOperation("ListDeploymentInstances"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListDeploymentInstancesRequestMarshaller(); 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("InvalidInstanceStatusException")); 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","InvalidInstanceStatusException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = ListDeploymentInstancesResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void ListDeploymentInstances_InvalidInstanceTypeExceptionMarshallTest() { var operation = service_model.FindOperation("ListDeploymentInstances"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListDeploymentInstancesRequestMarshaller(); 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("InvalidInstanceTypeException")); 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","InvalidInstanceTypeException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = ListDeploymentInstancesResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void ListDeploymentInstances_InvalidNextTokenExceptionMarshallTest() { var operation = service_model.FindOperation("ListDeploymentInstances"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListDeploymentInstancesRequestMarshaller(); 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("InvalidNextTokenException")); 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","InvalidNextTokenException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = ListDeploymentInstancesResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void ListDeploymentInstances_InvalidTargetFilterNameExceptionMarshallTest() { var operation = service_model.FindOperation("ListDeploymentInstances"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListDeploymentInstancesRequestMarshaller(); 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("InvalidTargetFilterNameException")); 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","InvalidTargetFilterNameException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = ListDeploymentInstancesResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void ListDeploymentsMarshallTest() { var request = InstantiateClassGenerator.Execute(); var marshaller = new ListDeploymentsRequestMarshaller(); 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("ListDeployments").ResponseStructure).Execute(); webResponse.Headers.Add("Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()); UnmarshallerContext context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), false, webResponse); var response = ListDeploymentsResponseUnmarshaller.Instance.Unmarshall(context) as ListDeploymentsResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void ListDeployments_ApplicationDoesNotExistExceptionMarshallTest() { var operation = service_model.FindOperation("ListDeployments"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListDeploymentsRequestMarshaller(); 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("ApplicationDoesNotExistException")); 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","ApplicationDoesNotExistException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = ListDeploymentsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void ListDeployments_ApplicationNameRequiredExceptionMarshallTest() { var operation = service_model.FindOperation("ListDeployments"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListDeploymentsRequestMarshaller(); 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("ApplicationNameRequiredException")); 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","ApplicationNameRequiredException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = ListDeploymentsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void ListDeployments_DeploymentGroupDoesNotExistExceptionMarshallTest() { var operation = service_model.FindOperation("ListDeployments"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListDeploymentsRequestMarshaller(); 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("DeploymentGroupDoesNotExistException")); 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","DeploymentGroupDoesNotExistException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = ListDeploymentsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void ListDeployments_DeploymentGroupNameRequiredExceptionMarshallTest() { var operation = service_model.FindOperation("ListDeployments"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListDeploymentsRequestMarshaller(); 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("DeploymentGroupNameRequiredException")); 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","DeploymentGroupNameRequiredException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = ListDeploymentsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void ListDeployments_InvalidApplicationNameExceptionMarshallTest() { var operation = service_model.FindOperation("ListDeployments"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListDeploymentsRequestMarshaller(); 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("InvalidApplicationNameException")); 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","InvalidApplicationNameException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = ListDeploymentsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void ListDeployments_InvalidDeploymentGroupNameExceptionMarshallTest() { var operation = service_model.FindOperation("ListDeployments"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListDeploymentsRequestMarshaller(); 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("InvalidDeploymentGroupNameException")); 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","InvalidDeploymentGroupNameException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = ListDeploymentsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void ListDeployments_InvalidDeploymentStatusExceptionMarshallTest() { var operation = service_model.FindOperation("ListDeployments"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListDeploymentsRequestMarshaller(); 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("InvalidDeploymentStatusException")); 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","InvalidDeploymentStatusException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = ListDeploymentsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void ListDeployments_InvalidExternalIdExceptionMarshallTest() { var operation = service_model.FindOperation("ListDeployments"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListDeploymentsRequestMarshaller(); 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("InvalidExternalIdException")); 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","InvalidExternalIdException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = ListDeploymentsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void ListDeployments_InvalidInputExceptionMarshallTest() { var operation = service_model.FindOperation("ListDeployments"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListDeploymentsRequestMarshaller(); 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 = ListDeploymentsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void ListDeployments_InvalidNextTokenExceptionMarshallTest() { var operation = service_model.FindOperation("ListDeployments"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListDeploymentsRequestMarshaller(); 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("InvalidNextTokenException")); 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","InvalidNextTokenException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = ListDeploymentsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void ListDeployments_InvalidTimeRangeExceptionMarshallTest() { var operation = service_model.FindOperation("ListDeployments"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListDeploymentsRequestMarshaller(); 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("InvalidTimeRangeException")); 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","InvalidTimeRangeException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = ListDeploymentsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void ListDeploymentTargetsMarshallTest() { var request = InstantiateClassGenerator.Execute(); var marshaller = new ListDeploymentTargetsRequestMarshaller(); 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("ListDeploymentTargets").ResponseStructure).Execute(); webResponse.Headers.Add("Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()); UnmarshallerContext context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), false, webResponse); var response = ListDeploymentTargetsResponseUnmarshaller.Instance.Unmarshall(context) as ListDeploymentTargetsResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void ListDeploymentTargets_DeploymentDoesNotExistExceptionMarshallTest() { var operation = service_model.FindOperation("ListDeploymentTargets"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListDeploymentTargetsRequestMarshaller(); 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("DeploymentDoesNotExistException")); 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","DeploymentDoesNotExistException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = ListDeploymentTargetsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void ListDeploymentTargets_DeploymentIdRequiredExceptionMarshallTest() { var operation = service_model.FindOperation("ListDeploymentTargets"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListDeploymentTargetsRequestMarshaller(); 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("DeploymentIdRequiredException")); 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","DeploymentIdRequiredException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = ListDeploymentTargetsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void ListDeploymentTargets_DeploymentNotStartedExceptionMarshallTest() { var operation = service_model.FindOperation("ListDeploymentTargets"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListDeploymentTargetsRequestMarshaller(); 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("DeploymentNotStartedException")); 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","DeploymentNotStartedException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = ListDeploymentTargetsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void ListDeploymentTargets_InvalidDeploymentIdExceptionMarshallTest() { var operation = service_model.FindOperation("ListDeploymentTargets"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListDeploymentTargetsRequestMarshaller(); 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("InvalidDeploymentIdException")); 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","InvalidDeploymentIdException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = ListDeploymentTargetsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void ListDeploymentTargets_InvalidDeploymentInstanceTypeExceptionMarshallTest() { var operation = service_model.FindOperation("ListDeploymentTargets"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListDeploymentTargetsRequestMarshaller(); 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("InvalidDeploymentInstanceTypeException")); 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","InvalidDeploymentInstanceTypeException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = ListDeploymentTargetsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void ListDeploymentTargets_InvalidInstanceStatusExceptionMarshallTest() { var operation = service_model.FindOperation("ListDeploymentTargets"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListDeploymentTargetsRequestMarshaller(); 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("InvalidInstanceStatusException")); 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","InvalidInstanceStatusException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = ListDeploymentTargetsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void ListDeploymentTargets_InvalidInstanceTypeExceptionMarshallTest() { var operation = service_model.FindOperation("ListDeploymentTargets"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListDeploymentTargetsRequestMarshaller(); 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("InvalidInstanceTypeException")); 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","InvalidInstanceTypeException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = ListDeploymentTargetsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void ListDeploymentTargets_InvalidNextTokenExceptionMarshallTest() { var operation = service_model.FindOperation("ListDeploymentTargets"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListDeploymentTargetsRequestMarshaller(); 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("InvalidNextTokenException")); 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","InvalidNextTokenException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = ListDeploymentTargetsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void ListGitHubAccountTokenNamesMarshallTest() { var request = InstantiateClassGenerator.Execute(); var marshaller = new ListGitHubAccountTokenNamesRequestMarshaller(); 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("ListGitHubAccountTokenNames").ResponseStructure).Execute(); webResponse.Headers.Add("Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()); UnmarshallerContext context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), false, webResponse); var response = ListGitHubAccountTokenNamesResponseUnmarshaller.Instance.Unmarshall(context) as ListGitHubAccountTokenNamesResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void ListGitHubAccountTokenNames_InvalidNextTokenExceptionMarshallTest() { var operation = service_model.FindOperation("ListGitHubAccountTokenNames"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListGitHubAccountTokenNamesRequestMarshaller(); 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("InvalidNextTokenException")); 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","InvalidNextTokenException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = ListGitHubAccountTokenNamesResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void ListGitHubAccountTokenNames_OperationNotSupportedExceptionMarshallTest() { var operation = service_model.FindOperation("ListGitHubAccountTokenNames"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListGitHubAccountTokenNamesRequestMarshaller(); 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("OperationNotSupportedException")); 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","OperationNotSupportedException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = ListGitHubAccountTokenNamesResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void ListGitHubAccountTokenNames_ResourceValidationExceptionMarshallTest() { var operation = service_model.FindOperation("ListGitHubAccountTokenNames"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListGitHubAccountTokenNamesRequestMarshaller(); 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("ResourceValidationException")); 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","ResourceValidationException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = ListGitHubAccountTokenNamesResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void ListOnPremisesInstancesMarshallTest() { var request = InstantiateClassGenerator.Execute(); var marshaller = new ListOnPremisesInstancesRequestMarshaller(); 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("ListOnPremisesInstances").ResponseStructure).Execute(); webResponse.Headers.Add("Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()); UnmarshallerContext context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), false, webResponse); var response = ListOnPremisesInstancesResponseUnmarshaller.Instance.Unmarshall(context) as ListOnPremisesInstancesResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void ListOnPremisesInstances_InvalidNextTokenExceptionMarshallTest() { var operation = service_model.FindOperation("ListOnPremisesInstances"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListOnPremisesInstancesRequestMarshaller(); 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("InvalidNextTokenException")); 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","InvalidNextTokenException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = ListOnPremisesInstancesResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void ListOnPremisesInstances_InvalidRegistrationStatusExceptionMarshallTest() { var operation = service_model.FindOperation("ListOnPremisesInstances"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListOnPremisesInstancesRequestMarshaller(); 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("InvalidRegistrationStatusException")); 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","InvalidRegistrationStatusException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = ListOnPremisesInstancesResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void ListOnPremisesInstances_InvalidTagFilterExceptionMarshallTest() { var operation = service_model.FindOperation("ListOnPremisesInstances"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListOnPremisesInstancesRequestMarshaller(); 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("InvalidTagFilterException")); 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","InvalidTagFilterException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = ListOnPremisesInstancesResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] 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("CodeDeploy")] public void ListTagsForResource_ArnNotSupportedExceptionMarshallTest() { 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("ArnNotSupportedException")); 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","ArnNotSupportedException"}, {"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("CodeDeploy")] public void ListTagsForResource_InvalidArnExceptionMarshallTest() { 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("InvalidArnException")); 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","InvalidArnException"}, {"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("CodeDeploy")] public void ListTagsForResource_ResourceArnRequiredExceptionMarshallTest() { 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("ResourceArnRequiredException")); 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","ResourceArnRequiredException"}, {"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("CodeDeploy")] public void PutLifecycleEventHookExecutionStatusMarshallTest() { var request = InstantiateClassGenerator.Execute(); var marshaller = new PutLifecycleEventHookExecutionStatusRequestMarshaller(); 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("PutLifecycleEventHookExecutionStatus").ResponseStructure).Execute(); webResponse.Headers.Add("Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()); UnmarshallerContext context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), false, webResponse); var response = PutLifecycleEventHookExecutionStatusResponseUnmarshaller.Instance.Unmarshall(context) as PutLifecycleEventHookExecutionStatusResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void PutLifecycleEventHookExecutionStatus_DeploymentDoesNotExistExceptionMarshallTest() { var operation = service_model.FindOperation("PutLifecycleEventHookExecutionStatus"); var request = InstantiateClassGenerator.Execute(); var marshaller = new PutLifecycleEventHookExecutionStatusRequestMarshaller(); 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("DeploymentDoesNotExistException")); 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","DeploymentDoesNotExistException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = PutLifecycleEventHookExecutionStatusResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void PutLifecycleEventHookExecutionStatus_DeploymentIdRequiredExceptionMarshallTest() { var operation = service_model.FindOperation("PutLifecycleEventHookExecutionStatus"); var request = InstantiateClassGenerator.Execute(); var marshaller = new PutLifecycleEventHookExecutionStatusRequestMarshaller(); 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("DeploymentIdRequiredException")); 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","DeploymentIdRequiredException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = PutLifecycleEventHookExecutionStatusResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void PutLifecycleEventHookExecutionStatus_InvalidDeploymentIdExceptionMarshallTest() { var operation = service_model.FindOperation("PutLifecycleEventHookExecutionStatus"); var request = InstantiateClassGenerator.Execute(); var marshaller = new PutLifecycleEventHookExecutionStatusRequestMarshaller(); 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("InvalidDeploymentIdException")); 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","InvalidDeploymentIdException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = PutLifecycleEventHookExecutionStatusResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void PutLifecycleEventHookExecutionStatus_InvalidLifecycleEventHookExecutionIdExceptionMarshallTest() { var operation = service_model.FindOperation("PutLifecycleEventHookExecutionStatus"); var request = InstantiateClassGenerator.Execute(); var marshaller = new PutLifecycleEventHookExecutionStatusRequestMarshaller(); 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("InvalidLifecycleEventHookExecutionIdException")); 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","InvalidLifecycleEventHookExecutionIdException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = PutLifecycleEventHookExecutionStatusResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void PutLifecycleEventHookExecutionStatus_InvalidLifecycleEventHookExecutionStatusExceptionMarshallTest() { var operation = service_model.FindOperation("PutLifecycleEventHookExecutionStatus"); var request = InstantiateClassGenerator.Execute(); var marshaller = new PutLifecycleEventHookExecutionStatusRequestMarshaller(); 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("InvalidLifecycleEventHookExecutionStatusException")); 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","InvalidLifecycleEventHookExecutionStatusException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = PutLifecycleEventHookExecutionStatusResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void PutLifecycleEventHookExecutionStatus_LifecycleEventAlreadyCompletedExceptionMarshallTest() { var operation = service_model.FindOperation("PutLifecycleEventHookExecutionStatus"); var request = InstantiateClassGenerator.Execute(); var marshaller = new PutLifecycleEventHookExecutionStatusRequestMarshaller(); 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("LifecycleEventAlreadyCompletedException")); 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","LifecycleEventAlreadyCompletedException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = PutLifecycleEventHookExecutionStatusResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void PutLifecycleEventHookExecutionStatus_UnsupportedActionForDeploymentTypeExceptionMarshallTest() { var operation = service_model.FindOperation("PutLifecycleEventHookExecutionStatus"); var request = InstantiateClassGenerator.Execute(); var marshaller = new PutLifecycleEventHookExecutionStatusRequestMarshaller(); 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("UnsupportedActionForDeploymentTypeException")); 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","UnsupportedActionForDeploymentTypeException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = PutLifecycleEventHookExecutionStatusResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void RegisterApplicationRevisionMarshallTest() { var request = InstantiateClassGenerator.Execute(); var marshaller = new RegisterApplicationRevisionRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void RegisterApplicationRevision_ApplicationDoesNotExistExceptionMarshallTest() { var operation = service_model.FindOperation("RegisterApplicationRevision"); var request = InstantiateClassGenerator.Execute(); var marshaller = new RegisterApplicationRevisionRequestMarshaller(); 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("ApplicationDoesNotExistException")); 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","ApplicationDoesNotExistException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = RegisterApplicationRevisionResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void RegisterApplicationRevision_ApplicationNameRequiredExceptionMarshallTest() { var operation = service_model.FindOperation("RegisterApplicationRevision"); var request = InstantiateClassGenerator.Execute(); var marshaller = new RegisterApplicationRevisionRequestMarshaller(); 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("ApplicationNameRequiredException")); 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","ApplicationNameRequiredException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = RegisterApplicationRevisionResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void RegisterApplicationRevision_DescriptionTooLongExceptionMarshallTest() { var operation = service_model.FindOperation("RegisterApplicationRevision"); var request = InstantiateClassGenerator.Execute(); var marshaller = new RegisterApplicationRevisionRequestMarshaller(); 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("DescriptionTooLongException")); 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","DescriptionTooLongException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = RegisterApplicationRevisionResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void RegisterApplicationRevision_InvalidApplicationNameExceptionMarshallTest() { var operation = service_model.FindOperation("RegisterApplicationRevision"); var request = InstantiateClassGenerator.Execute(); var marshaller = new RegisterApplicationRevisionRequestMarshaller(); 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("InvalidApplicationNameException")); 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","InvalidApplicationNameException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = RegisterApplicationRevisionResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void RegisterApplicationRevision_InvalidRevisionExceptionMarshallTest() { var operation = service_model.FindOperation("RegisterApplicationRevision"); var request = InstantiateClassGenerator.Execute(); var marshaller = new RegisterApplicationRevisionRequestMarshaller(); 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("InvalidRevisionException")); 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","InvalidRevisionException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = RegisterApplicationRevisionResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void RegisterApplicationRevision_RevisionRequiredExceptionMarshallTest() { var operation = service_model.FindOperation("RegisterApplicationRevision"); var request = InstantiateClassGenerator.Execute(); var marshaller = new RegisterApplicationRevisionRequestMarshaller(); 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("RevisionRequiredException")); 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","RevisionRequiredException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = RegisterApplicationRevisionResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void RegisterOnPremisesInstanceMarshallTest() { var request = InstantiateClassGenerator.Execute(); var marshaller = new RegisterOnPremisesInstanceRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void RegisterOnPremisesInstance_IamArnRequiredExceptionMarshallTest() { var operation = service_model.FindOperation("RegisterOnPremisesInstance"); var request = InstantiateClassGenerator.Execute(); var marshaller = new RegisterOnPremisesInstanceRequestMarshaller(); 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("IamArnRequiredException")); 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","IamArnRequiredException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = RegisterOnPremisesInstanceResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void RegisterOnPremisesInstance_IamSessionArnAlreadyRegisteredExceptionMarshallTest() { var operation = service_model.FindOperation("RegisterOnPremisesInstance"); var request = InstantiateClassGenerator.Execute(); var marshaller = new RegisterOnPremisesInstanceRequestMarshaller(); 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("IamSessionArnAlreadyRegisteredException")); 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","IamSessionArnAlreadyRegisteredException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = RegisterOnPremisesInstanceResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void RegisterOnPremisesInstance_IamUserArnAlreadyRegisteredExceptionMarshallTest() { var operation = service_model.FindOperation("RegisterOnPremisesInstance"); var request = InstantiateClassGenerator.Execute(); var marshaller = new RegisterOnPremisesInstanceRequestMarshaller(); 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("IamUserArnAlreadyRegisteredException")); 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","IamUserArnAlreadyRegisteredException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = RegisterOnPremisesInstanceResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void RegisterOnPremisesInstance_IamUserArnRequiredExceptionMarshallTest() { var operation = service_model.FindOperation("RegisterOnPremisesInstance"); var request = InstantiateClassGenerator.Execute(); var marshaller = new RegisterOnPremisesInstanceRequestMarshaller(); 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("IamUserArnRequiredException")); 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","IamUserArnRequiredException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = RegisterOnPremisesInstanceResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void RegisterOnPremisesInstance_InstanceNameAlreadyRegisteredExceptionMarshallTest() { var operation = service_model.FindOperation("RegisterOnPremisesInstance"); var request = InstantiateClassGenerator.Execute(); var marshaller = new RegisterOnPremisesInstanceRequestMarshaller(); 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("InstanceNameAlreadyRegisteredException")); 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","InstanceNameAlreadyRegisteredException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = RegisterOnPremisesInstanceResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void RegisterOnPremisesInstance_InstanceNameRequiredExceptionMarshallTest() { var operation = service_model.FindOperation("RegisterOnPremisesInstance"); var request = InstantiateClassGenerator.Execute(); var marshaller = new RegisterOnPremisesInstanceRequestMarshaller(); 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("InstanceNameRequiredException")); 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","InstanceNameRequiredException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = RegisterOnPremisesInstanceResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void RegisterOnPremisesInstance_InvalidIamSessionArnExceptionMarshallTest() { var operation = service_model.FindOperation("RegisterOnPremisesInstance"); var request = InstantiateClassGenerator.Execute(); var marshaller = new RegisterOnPremisesInstanceRequestMarshaller(); 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("InvalidIamSessionArnException")); 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","InvalidIamSessionArnException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = RegisterOnPremisesInstanceResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void RegisterOnPremisesInstance_InvalidIamUserArnExceptionMarshallTest() { var operation = service_model.FindOperation("RegisterOnPremisesInstance"); var request = InstantiateClassGenerator.Execute(); var marshaller = new RegisterOnPremisesInstanceRequestMarshaller(); 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("InvalidIamUserArnException")); 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","InvalidIamUserArnException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = RegisterOnPremisesInstanceResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void RegisterOnPremisesInstance_InvalidInstanceNameExceptionMarshallTest() { var operation = service_model.FindOperation("RegisterOnPremisesInstance"); var request = InstantiateClassGenerator.Execute(); var marshaller = new RegisterOnPremisesInstanceRequestMarshaller(); 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("InvalidInstanceNameException")); 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","InvalidInstanceNameException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = RegisterOnPremisesInstanceResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void RegisterOnPremisesInstance_MultipleIamArnsProvidedExceptionMarshallTest() { var operation = service_model.FindOperation("RegisterOnPremisesInstance"); var request = InstantiateClassGenerator.Execute(); var marshaller = new RegisterOnPremisesInstanceRequestMarshaller(); 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("MultipleIamArnsProvidedException")); 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","MultipleIamArnsProvidedException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = RegisterOnPremisesInstanceResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void RemoveTagsFromOnPremisesInstancesMarshallTest() { var request = InstantiateClassGenerator.Execute(); var marshaller = new RemoveTagsFromOnPremisesInstancesRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void RemoveTagsFromOnPremisesInstances_InstanceLimitExceededExceptionMarshallTest() { var operation = service_model.FindOperation("RemoveTagsFromOnPremisesInstances"); var request = InstantiateClassGenerator.Execute(); var marshaller = new RemoveTagsFromOnPremisesInstancesRequestMarshaller(); 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("InstanceLimitExceededException")); 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","InstanceLimitExceededException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = RemoveTagsFromOnPremisesInstancesResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void RemoveTagsFromOnPremisesInstances_InstanceNameRequiredExceptionMarshallTest() { var operation = service_model.FindOperation("RemoveTagsFromOnPremisesInstances"); var request = InstantiateClassGenerator.Execute(); var marshaller = new RemoveTagsFromOnPremisesInstancesRequestMarshaller(); 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("InstanceNameRequiredException")); 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","InstanceNameRequiredException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = RemoveTagsFromOnPremisesInstancesResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void RemoveTagsFromOnPremisesInstances_InstanceNotRegisteredExceptionMarshallTest() { var operation = service_model.FindOperation("RemoveTagsFromOnPremisesInstances"); var request = InstantiateClassGenerator.Execute(); var marshaller = new RemoveTagsFromOnPremisesInstancesRequestMarshaller(); 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("InstanceNotRegisteredException")); 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","InstanceNotRegisteredException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = RemoveTagsFromOnPremisesInstancesResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void RemoveTagsFromOnPremisesInstances_InvalidInstanceNameExceptionMarshallTest() { var operation = service_model.FindOperation("RemoveTagsFromOnPremisesInstances"); var request = InstantiateClassGenerator.Execute(); var marshaller = new RemoveTagsFromOnPremisesInstancesRequestMarshaller(); 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("InvalidInstanceNameException")); 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","InvalidInstanceNameException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = RemoveTagsFromOnPremisesInstancesResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void RemoveTagsFromOnPremisesInstances_InvalidTagExceptionMarshallTest() { var operation = service_model.FindOperation("RemoveTagsFromOnPremisesInstances"); var request = InstantiateClassGenerator.Execute(); var marshaller = new RemoveTagsFromOnPremisesInstancesRequestMarshaller(); 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("InvalidTagException")); 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","InvalidTagException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = RemoveTagsFromOnPremisesInstancesResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void RemoveTagsFromOnPremisesInstances_TagLimitExceededExceptionMarshallTest() { var operation = service_model.FindOperation("RemoveTagsFromOnPremisesInstances"); var request = InstantiateClassGenerator.Execute(); var marshaller = new RemoveTagsFromOnPremisesInstancesRequestMarshaller(); 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("TagLimitExceededException")); 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","TagLimitExceededException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = RemoveTagsFromOnPremisesInstancesResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void RemoveTagsFromOnPremisesInstances_TagRequiredExceptionMarshallTest() { var operation = service_model.FindOperation("RemoveTagsFromOnPremisesInstances"); var request = InstantiateClassGenerator.Execute(); var marshaller = new RemoveTagsFromOnPremisesInstancesRequestMarshaller(); 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("TagRequiredException")); 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","TagRequiredException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = RemoveTagsFromOnPremisesInstancesResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void SkipWaitTimeForInstanceTerminationMarshallTest() { var request = InstantiateClassGenerator.Execute(); var marshaller = new SkipWaitTimeForInstanceTerminationRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void SkipWaitTimeForInstanceTermination_DeploymentAlreadyCompletedExceptionMarshallTest() { var operation = service_model.FindOperation("SkipWaitTimeForInstanceTermination"); var request = InstantiateClassGenerator.Execute(); var marshaller = new SkipWaitTimeForInstanceTerminationRequestMarshaller(); 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("DeploymentAlreadyCompletedException")); 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","DeploymentAlreadyCompletedException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = SkipWaitTimeForInstanceTerminationResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void SkipWaitTimeForInstanceTermination_DeploymentDoesNotExistExceptionMarshallTest() { var operation = service_model.FindOperation("SkipWaitTimeForInstanceTermination"); var request = InstantiateClassGenerator.Execute(); var marshaller = new SkipWaitTimeForInstanceTerminationRequestMarshaller(); 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("DeploymentDoesNotExistException")); 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","DeploymentDoesNotExistException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = SkipWaitTimeForInstanceTerminationResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void SkipWaitTimeForInstanceTermination_DeploymentIdRequiredExceptionMarshallTest() { var operation = service_model.FindOperation("SkipWaitTimeForInstanceTermination"); var request = InstantiateClassGenerator.Execute(); var marshaller = new SkipWaitTimeForInstanceTerminationRequestMarshaller(); 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("DeploymentIdRequiredException")); 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","DeploymentIdRequiredException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = SkipWaitTimeForInstanceTerminationResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void SkipWaitTimeForInstanceTermination_DeploymentNotStartedExceptionMarshallTest() { var operation = service_model.FindOperation("SkipWaitTimeForInstanceTermination"); var request = InstantiateClassGenerator.Execute(); var marshaller = new SkipWaitTimeForInstanceTerminationRequestMarshaller(); 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("DeploymentNotStartedException")); 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","DeploymentNotStartedException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = SkipWaitTimeForInstanceTerminationResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void SkipWaitTimeForInstanceTermination_InvalidDeploymentIdExceptionMarshallTest() { var operation = service_model.FindOperation("SkipWaitTimeForInstanceTermination"); var request = InstantiateClassGenerator.Execute(); var marshaller = new SkipWaitTimeForInstanceTerminationRequestMarshaller(); 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("InvalidDeploymentIdException")); 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","InvalidDeploymentIdException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = SkipWaitTimeForInstanceTerminationResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void SkipWaitTimeForInstanceTermination_UnsupportedActionForDeploymentTypeExceptionMarshallTest() { var operation = service_model.FindOperation("SkipWaitTimeForInstanceTermination"); var request = InstantiateClassGenerator.Execute(); var marshaller = new SkipWaitTimeForInstanceTerminationRequestMarshaller(); 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("UnsupportedActionForDeploymentTypeException")); 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","UnsupportedActionForDeploymentTypeException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = SkipWaitTimeForInstanceTerminationResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void StopDeploymentMarshallTest() { var request = InstantiateClassGenerator.Execute(); var marshaller = new StopDeploymentRequestMarshaller(); 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("StopDeployment").ResponseStructure).Execute(); webResponse.Headers.Add("Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()); UnmarshallerContext context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), false, webResponse); var response = StopDeploymentResponseUnmarshaller.Instance.Unmarshall(context) as StopDeploymentResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void StopDeployment_DeploymentAlreadyCompletedExceptionMarshallTest() { var operation = service_model.FindOperation("StopDeployment"); var request = InstantiateClassGenerator.Execute(); var marshaller = new StopDeploymentRequestMarshaller(); 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("DeploymentAlreadyCompletedException")); 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","DeploymentAlreadyCompletedException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = StopDeploymentResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void StopDeployment_DeploymentDoesNotExistExceptionMarshallTest() { var operation = service_model.FindOperation("StopDeployment"); var request = InstantiateClassGenerator.Execute(); var marshaller = new StopDeploymentRequestMarshaller(); 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("DeploymentDoesNotExistException")); 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","DeploymentDoesNotExistException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = StopDeploymentResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void StopDeployment_DeploymentGroupDoesNotExistExceptionMarshallTest() { var operation = service_model.FindOperation("StopDeployment"); var request = InstantiateClassGenerator.Execute(); var marshaller = new StopDeploymentRequestMarshaller(); 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("DeploymentGroupDoesNotExistException")); 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","DeploymentGroupDoesNotExistException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = StopDeploymentResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void StopDeployment_DeploymentIdRequiredExceptionMarshallTest() { var operation = service_model.FindOperation("StopDeployment"); var request = InstantiateClassGenerator.Execute(); var marshaller = new StopDeploymentRequestMarshaller(); 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("DeploymentIdRequiredException")); 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","DeploymentIdRequiredException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = StopDeploymentResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void StopDeployment_InvalidDeploymentIdExceptionMarshallTest() { var operation = service_model.FindOperation("StopDeployment"); var request = InstantiateClassGenerator.Execute(); var marshaller = new StopDeploymentRequestMarshaller(); 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("InvalidDeploymentIdException")); 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","InvalidDeploymentIdException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = StopDeploymentResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void StopDeployment_UnsupportedActionForDeploymentTypeExceptionMarshallTest() { var operation = service_model.FindOperation("StopDeployment"); var request = InstantiateClassGenerator.Execute(); var marshaller = new StopDeploymentRequestMarshaller(); 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("UnsupportedActionForDeploymentTypeException")); 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","UnsupportedActionForDeploymentTypeException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = StopDeploymentResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void TagResourceMarshallTest() { var request = InstantiateClassGenerator.Execute(); var marshaller = new TagResourceRequestMarshaller(); 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("TagResource").ResponseStructure).Execute(); webResponse.Headers.Add("Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()); UnmarshallerContext context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), false, webResponse); var response = TagResourceResponseUnmarshaller.Instance.Unmarshall(context) as TagResourceResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void TagResource_ApplicationDoesNotExistExceptionMarshallTest() { var operation = service_model.FindOperation("TagResource"); var request = InstantiateClassGenerator.Execute(); var marshaller = new TagResourceRequestMarshaller(); 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("ApplicationDoesNotExistException")); 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","ApplicationDoesNotExistException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = TagResourceResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void TagResource_ArnNotSupportedExceptionMarshallTest() { var operation = service_model.FindOperation("TagResource"); var request = InstantiateClassGenerator.Execute(); var marshaller = new TagResourceRequestMarshaller(); 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("ArnNotSupportedException")); 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","ArnNotSupportedException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = TagResourceResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void TagResource_DeploymentConfigDoesNotExistExceptionMarshallTest() { var operation = service_model.FindOperation("TagResource"); var request = InstantiateClassGenerator.Execute(); var marshaller = new TagResourceRequestMarshaller(); 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("DeploymentConfigDoesNotExistException")); 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","DeploymentConfigDoesNotExistException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = TagResourceResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void TagResource_DeploymentGroupDoesNotExistExceptionMarshallTest() { var operation = service_model.FindOperation("TagResource"); var request = InstantiateClassGenerator.Execute(); var marshaller = new TagResourceRequestMarshaller(); 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("DeploymentGroupDoesNotExistException")); 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","DeploymentGroupDoesNotExistException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = TagResourceResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void TagResource_InvalidArnExceptionMarshallTest() { var operation = service_model.FindOperation("TagResource"); var request = InstantiateClassGenerator.Execute(); var marshaller = new TagResourceRequestMarshaller(); 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("InvalidArnException")); 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","InvalidArnException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = TagResourceResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void TagResource_InvalidTagsToAddExceptionMarshallTest() { var operation = service_model.FindOperation("TagResource"); var request = InstantiateClassGenerator.Execute(); var marshaller = new TagResourceRequestMarshaller(); 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("InvalidTagsToAddException")); 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","InvalidTagsToAddException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = TagResourceResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void TagResource_ResourceArnRequiredExceptionMarshallTest() { var operation = service_model.FindOperation("TagResource"); var request = InstantiateClassGenerator.Execute(); var marshaller = new TagResourceRequestMarshaller(); 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("ResourceArnRequiredException")); 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","ResourceArnRequiredException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = TagResourceResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void TagResource_TagRequiredExceptionMarshallTest() { var operation = service_model.FindOperation("TagResource"); var request = InstantiateClassGenerator.Execute(); var marshaller = new TagResourceRequestMarshaller(); 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("TagRequiredException")); 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","TagRequiredException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = TagResourceResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void UntagResourceMarshallTest() { var request = InstantiateClassGenerator.Execute(); var marshaller = new UntagResourceRequestMarshaller(); 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("UntagResource").ResponseStructure).Execute(); webResponse.Headers.Add("Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()); UnmarshallerContext context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), false, webResponse); var response = UntagResourceResponseUnmarshaller.Instance.Unmarshall(context) as UntagResourceResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void UntagResource_ApplicationDoesNotExistExceptionMarshallTest() { var operation = service_model.FindOperation("UntagResource"); var request = InstantiateClassGenerator.Execute(); var marshaller = new UntagResourceRequestMarshaller(); 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("ApplicationDoesNotExistException")); 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","ApplicationDoesNotExistException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = UntagResourceResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void UntagResource_ArnNotSupportedExceptionMarshallTest() { var operation = service_model.FindOperation("UntagResource"); var request = InstantiateClassGenerator.Execute(); var marshaller = new UntagResourceRequestMarshaller(); 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("ArnNotSupportedException")); 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","ArnNotSupportedException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = UntagResourceResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void UntagResource_DeploymentConfigDoesNotExistExceptionMarshallTest() { var operation = service_model.FindOperation("UntagResource"); var request = InstantiateClassGenerator.Execute(); var marshaller = new UntagResourceRequestMarshaller(); 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("DeploymentConfigDoesNotExistException")); 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","DeploymentConfigDoesNotExistException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = UntagResourceResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void UntagResource_DeploymentGroupDoesNotExistExceptionMarshallTest() { var operation = service_model.FindOperation("UntagResource"); var request = InstantiateClassGenerator.Execute(); var marshaller = new UntagResourceRequestMarshaller(); 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("DeploymentGroupDoesNotExistException")); 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","DeploymentGroupDoesNotExistException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = UntagResourceResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void UntagResource_InvalidArnExceptionMarshallTest() { var operation = service_model.FindOperation("UntagResource"); var request = InstantiateClassGenerator.Execute(); var marshaller = new UntagResourceRequestMarshaller(); 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("InvalidArnException")); 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","InvalidArnException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = UntagResourceResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void UntagResource_InvalidTagsToAddExceptionMarshallTest() { var operation = service_model.FindOperation("UntagResource"); var request = InstantiateClassGenerator.Execute(); var marshaller = new UntagResourceRequestMarshaller(); 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("InvalidTagsToAddException")); 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","InvalidTagsToAddException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = UntagResourceResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void UntagResource_ResourceArnRequiredExceptionMarshallTest() { var operation = service_model.FindOperation("UntagResource"); var request = InstantiateClassGenerator.Execute(); var marshaller = new UntagResourceRequestMarshaller(); 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("ResourceArnRequiredException")); 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","ResourceArnRequiredException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = UntagResourceResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void UntagResource_TagRequiredExceptionMarshallTest() { var operation = service_model.FindOperation("UntagResource"); var request = InstantiateClassGenerator.Execute(); var marshaller = new UntagResourceRequestMarshaller(); 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("TagRequiredException")); 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","TagRequiredException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = UntagResourceResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void UpdateApplicationMarshallTest() { var request = InstantiateClassGenerator.Execute(); var marshaller = new UpdateApplicationRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson(request,jsonRequest); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void UpdateApplication_ApplicationAlreadyExistsExceptionMarshallTest() { var operation = service_model.FindOperation("UpdateApplication"); var request = InstantiateClassGenerator.Execute(); var marshaller = new UpdateApplicationRequestMarshaller(); 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("ApplicationAlreadyExistsException")); 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","ApplicationAlreadyExistsException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = UpdateApplicationResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void UpdateApplication_ApplicationDoesNotExistExceptionMarshallTest() { var operation = service_model.FindOperation("UpdateApplication"); var request = InstantiateClassGenerator.Execute(); var marshaller = new UpdateApplicationRequestMarshaller(); 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("ApplicationDoesNotExistException")); 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","ApplicationDoesNotExistException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = UpdateApplicationResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void UpdateApplication_ApplicationNameRequiredExceptionMarshallTest() { var operation = service_model.FindOperation("UpdateApplication"); var request = InstantiateClassGenerator.Execute(); var marshaller = new UpdateApplicationRequestMarshaller(); 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("ApplicationNameRequiredException")); 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","ApplicationNameRequiredException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = UpdateApplicationResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void UpdateApplication_InvalidApplicationNameExceptionMarshallTest() { var operation = service_model.FindOperation("UpdateApplication"); var request = InstantiateClassGenerator.Execute(); var marshaller = new UpdateApplicationRequestMarshaller(); 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("InvalidApplicationNameException")); 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","InvalidApplicationNameException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = UpdateApplicationResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void UpdateDeploymentGroupMarshallTest() { var request = InstantiateClassGenerator.Execute(); var marshaller = new UpdateDeploymentGroupRequestMarshaller(); 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("UpdateDeploymentGroup").ResponseStructure).Execute(); webResponse.Headers.Add("Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()); UnmarshallerContext context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), false, webResponse); var response = UpdateDeploymentGroupResponseUnmarshaller.Instance.Unmarshall(context) as UpdateDeploymentGroupResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void UpdateDeploymentGroup_AlarmsLimitExceededExceptionMarshallTest() { var operation = service_model.FindOperation("UpdateDeploymentGroup"); var request = InstantiateClassGenerator.Execute(); var marshaller = new UpdateDeploymentGroupRequestMarshaller(); 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("AlarmsLimitExceededException")); 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","AlarmsLimitExceededException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = UpdateDeploymentGroupResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void UpdateDeploymentGroup_ApplicationDoesNotExistExceptionMarshallTest() { var operation = service_model.FindOperation("UpdateDeploymentGroup"); var request = InstantiateClassGenerator.Execute(); var marshaller = new UpdateDeploymentGroupRequestMarshaller(); 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("ApplicationDoesNotExistException")); 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","ApplicationDoesNotExistException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = UpdateDeploymentGroupResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void UpdateDeploymentGroup_ApplicationNameRequiredExceptionMarshallTest() { var operation = service_model.FindOperation("UpdateDeploymentGroup"); var request = InstantiateClassGenerator.Execute(); var marshaller = new UpdateDeploymentGroupRequestMarshaller(); 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("ApplicationNameRequiredException")); 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","ApplicationNameRequiredException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = UpdateDeploymentGroupResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void UpdateDeploymentGroup_DeploymentConfigDoesNotExistExceptionMarshallTest() { var operation = service_model.FindOperation("UpdateDeploymentGroup"); var request = InstantiateClassGenerator.Execute(); var marshaller = new UpdateDeploymentGroupRequestMarshaller(); 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("DeploymentConfigDoesNotExistException")); 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","DeploymentConfigDoesNotExistException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = UpdateDeploymentGroupResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void UpdateDeploymentGroup_DeploymentGroupAlreadyExistsExceptionMarshallTest() { var operation = service_model.FindOperation("UpdateDeploymentGroup"); var request = InstantiateClassGenerator.Execute(); var marshaller = new UpdateDeploymentGroupRequestMarshaller(); 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("DeploymentGroupAlreadyExistsException")); 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","DeploymentGroupAlreadyExistsException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = UpdateDeploymentGroupResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void UpdateDeploymentGroup_DeploymentGroupDoesNotExistExceptionMarshallTest() { var operation = service_model.FindOperation("UpdateDeploymentGroup"); var request = InstantiateClassGenerator.Execute(); var marshaller = new UpdateDeploymentGroupRequestMarshaller(); 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("DeploymentGroupDoesNotExistException")); 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","DeploymentGroupDoesNotExistException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = UpdateDeploymentGroupResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void UpdateDeploymentGroup_DeploymentGroupNameRequiredExceptionMarshallTest() { var operation = service_model.FindOperation("UpdateDeploymentGroup"); var request = InstantiateClassGenerator.Execute(); var marshaller = new UpdateDeploymentGroupRequestMarshaller(); 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("DeploymentGroupNameRequiredException")); 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","DeploymentGroupNameRequiredException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = UpdateDeploymentGroupResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void UpdateDeploymentGroup_ECSServiceMappingLimitExceededExceptionMarshallTest() { var operation = service_model.FindOperation("UpdateDeploymentGroup"); var request = InstantiateClassGenerator.Execute(); var marshaller = new UpdateDeploymentGroupRequestMarshaller(); 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("ECSServiceMappingLimitExceededException")); 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","ECSServiceMappingLimitExceededException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = UpdateDeploymentGroupResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void UpdateDeploymentGroup_InvalidAlarmConfigExceptionMarshallTest() { var operation = service_model.FindOperation("UpdateDeploymentGroup"); var request = InstantiateClassGenerator.Execute(); var marshaller = new UpdateDeploymentGroupRequestMarshaller(); 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("InvalidAlarmConfigException")); 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","InvalidAlarmConfigException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = UpdateDeploymentGroupResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void UpdateDeploymentGroup_InvalidApplicationNameExceptionMarshallTest() { var operation = service_model.FindOperation("UpdateDeploymentGroup"); var request = InstantiateClassGenerator.Execute(); var marshaller = new UpdateDeploymentGroupRequestMarshaller(); 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("InvalidApplicationNameException")); 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","InvalidApplicationNameException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = UpdateDeploymentGroupResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void UpdateDeploymentGroup_InvalidAutoRollbackConfigExceptionMarshallTest() { var operation = service_model.FindOperation("UpdateDeploymentGroup"); var request = InstantiateClassGenerator.Execute(); var marshaller = new UpdateDeploymentGroupRequestMarshaller(); 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("InvalidAutoRollbackConfigException")); 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","InvalidAutoRollbackConfigException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = UpdateDeploymentGroupResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void UpdateDeploymentGroup_InvalidAutoScalingGroupExceptionMarshallTest() { var operation = service_model.FindOperation("UpdateDeploymentGroup"); var request = InstantiateClassGenerator.Execute(); var marshaller = new UpdateDeploymentGroupRequestMarshaller(); 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("InvalidAutoScalingGroupException")); 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","InvalidAutoScalingGroupException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = UpdateDeploymentGroupResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void UpdateDeploymentGroup_InvalidBlueGreenDeploymentConfigurationExceptionMarshallTest() { var operation = service_model.FindOperation("UpdateDeploymentGroup"); var request = InstantiateClassGenerator.Execute(); var marshaller = new UpdateDeploymentGroupRequestMarshaller(); 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("InvalidBlueGreenDeploymentConfigurationException")); 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","InvalidBlueGreenDeploymentConfigurationException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = UpdateDeploymentGroupResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void UpdateDeploymentGroup_InvalidDeploymentConfigNameExceptionMarshallTest() { var operation = service_model.FindOperation("UpdateDeploymentGroup"); var request = InstantiateClassGenerator.Execute(); var marshaller = new UpdateDeploymentGroupRequestMarshaller(); 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("InvalidDeploymentConfigNameException")); 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","InvalidDeploymentConfigNameException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = UpdateDeploymentGroupResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void UpdateDeploymentGroup_InvalidDeploymentGroupNameExceptionMarshallTest() { var operation = service_model.FindOperation("UpdateDeploymentGroup"); var request = InstantiateClassGenerator.Execute(); var marshaller = new UpdateDeploymentGroupRequestMarshaller(); 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("InvalidDeploymentGroupNameException")); 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","InvalidDeploymentGroupNameException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = UpdateDeploymentGroupResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void UpdateDeploymentGroup_InvalidDeploymentStyleExceptionMarshallTest() { var operation = service_model.FindOperation("UpdateDeploymentGroup"); var request = InstantiateClassGenerator.Execute(); var marshaller = new UpdateDeploymentGroupRequestMarshaller(); 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("InvalidDeploymentStyleException")); 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","InvalidDeploymentStyleException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = UpdateDeploymentGroupResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void UpdateDeploymentGroup_InvalidEC2TagCombinationExceptionMarshallTest() { var operation = service_model.FindOperation("UpdateDeploymentGroup"); var request = InstantiateClassGenerator.Execute(); var marshaller = new UpdateDeploymentGroupRequestMarshaller(); 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("InvalidEC2TagCombinationException")); 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","InvalidEC2TagCombinationException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = UpdateDeploymentGroupResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void UpdateDeploymentGroup_InvalidEC2TagExceptionMarshallTest() { var operation = service_model.FindOperation("UpdateDeploymentGroup"); var request = InstantiateClassGenerator.Execute(); var marshaller = new UpdateDeploymentGroupRequestMarshaller(); 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("InvalidEC2TagException")); 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","InvalidEC2TagException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = UpdateDeploymentGroupResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void UpdateDeploymentGroup_InvalidECSServiceExceptionMarshallTest() { var operation = service_model.FindOperation("UpdateDeploymentGroup"); var request = InstantiateClassGenerator.Execute(); var marshaller = new UpdateDeploymentGroupRequestMarshaller(); 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("InvalidECSServiceException")); 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","InvalidECSServiceException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = UpdateDeploymentGroupResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void UpdateDeploymentGroup_InvalidInputExceptionMarshallTest() { var operation = service_model.FindOperation("UpdateDeploymentGroup"); var request = InstantiateClassGenerator.Execute(); var marshaller = new UpdateDeploymentGroupRequestMarshaller(); 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 = UpdateDeploymentGroupResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void UpdateDeploymentGroup_InvalidLoadBalancerInfoExceptionMarshallTest() { var operation = service_model.FindOperation("UpdateDeploymentGroup"); var request = InstantiateClassGenerator.Execute(); var marshaller = new UpdateDeploymentGroupRequestMarshaller(); 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("InvalidLoadBalancerInfoException")); 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","InvalidLoadBalancerInfoException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = UpdateDeploymentGroupResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void UpdateDeploymentGroup_InvalidOnPremisesTagCombinationExceptionMarshallTest() { var operation = service_model.FindOperation("UpdateDeploymentGroup"); var request = InstantiateClassGenerator.Execute(); var marshaller = new UpdateDeploymentGroupRequestMarshaller(); 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("InvalidOnPremisesTagCombinationException")); 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","InvalidOnPremisesTagCombinationException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = UpdateDeploymentGroupResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void UpdateDeploymentGroup_InvalidRoleExceptionMarshallTest() { var operation = service_model.FindOperation("UpdateDeploymentGroup"); var request = InstantiateClassGenerator.Execute(); var marshaller = new UpdateDeploymentGroupRequestMarshaller(); 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("InvalidRoleException")); 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","InvalidRoleException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = UpdateDeploymentGroupResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void UpdateDeploymentGroup_InvalidTagExceptionMarshallTest() { var operation = service_model.FindOperation("UpdateDeploymentGroup"); var request = InstantiateClassGenerator.Execute(); var marshaller = new UpdateDeploymentGroupRequestMarshaller(); 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("InvalidTagException")); 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","InvalidTagException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = UpdateDeploymentGroupResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void UpdateDeploymentGroup_InvalidTargetGroupPairExceptionMarshallTest() { var operation = service_model.FindOperation("UpdateDeploymentGroup"); var request = InstantiateClassGenerator.Execute(); var marshaller = new UpdateDeploymentGroupRequestMarshaller(); 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("InvalidTargetGroupPairException")); 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","InvalidTargetGroupPairException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = UpdateDeploymentGroupResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void UpdateDeploymentGroup_InvalidTrafficRoutingConfigurationExceptionMarshallTest() { var operation = service_model.FindOperation("UpdateDeploymentGroup"); var request = InstantiateClassGenerator.Execute(); var marshaller = new UpdateDeploymentGroupRequestMarshaller(); 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("InvalidTrafficRoutingConfigurationException")); 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","InvalidTrafficRoutingConfigurationException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = UpdateDeploymentGroupResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void UpdateDeploymentGroup_InvalidTriggerConfigExceptionMarshallTest() { var operation = service_model.FindOperation("UpdateDeploymentGroup"); var request = InstantiateClassGenerator.Execute(); var marshaller = new UpdateDeploymentGroupRequestMarshaller(); 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("InvalidTriggerConfigException")); 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","InvalidTriggerConfigException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = UpdateDeploymentGroupResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void UpdateDeploymentGroup_LifecycleHookLimitExceededExceptionMarshallTest() { var operation = service_model.FindOperation("UpdateDeploymentGroup"); var request = InstantiateClassGenerator.Execute(); var marshaller = new UpdateDeploymentGroupRequestMarshaller(); 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("LifecycleHookLimitExceededException")); 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","LifecycleHookLimitExceededException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = UpdateDeploymentGroupResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void UpdateDeploymentGroup_TagSetListLimitExceededExceptionMarshallTest() { var operation = service_model.FindOperation("UpdateDeploymentGroup"); var request = InstantiateClassGenerator.Execute(); var marshaller = new UpdateDeploymentGroupRequestMarshaller(); 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("TagSetListLimitExceededException")); 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","TagSetListLimitExceededException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = UpdateDeploymentGroupResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void UpdateDeploymentGroup_ThrottlingExceptionMarshallTest() { var operation = service_model.FindOperation("UpdateDeploymentGroup"); var request = InstantiateClassGenerator.Execute(); var marshaller = new UpdateDeploymentGroupRequestMarshaller(); 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("ThrottlingException")); 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","ThrottlingException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = UpdateDeploymentGroupResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Json")] [TestCategory("CodeDeploy")] public void UpdateDeploymentGroup_TriggerTargetsLimitExceededExceptionMarshallTest() { var operation = service_model.FindOperation("UpdateDeploymentGroup"); var request = InstantiateClassGenerator.Execute(); var marshaller = new UpdateDeploymentGroupRequestMarshaller(); 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("TriggerTargetsLimitExceededException")); 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","TriggerTargetsLimitExceededException"}, {"Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()} } }; var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), true, webResponse, true); var response = UpdateDeploymentGroupResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } } }