/* * 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 kinesis-video-archived-media-2017-09-30.normal.json service model. */ using System; using System.Globalization; using System.IO; using System.Linq; using System.Text; using Microsoft.VisualStudio.TestTools.UnitTesting; using Amazon.KinesisVideoArchivedMedia; using Amazon.KinesisVideoArchivedMedia.Model; using Amazon.KinesisVideoArchivedMedia.Model.Internal.MarshallTransformations; using Amazon.Runtime.Internal.Transform; using Amazon.Util; using ServiceClientGenerator; using AWSSDK_DotNet35.UnitTests.TestTools; namespace AWSSDK_DotNet35.UnitTests.Marshalling { [TestClass] public partial class KinesisVideoArchivedMediaMarshallingTests { static readonly ServiceModel service_model = Utils.LoadServiceModel("kinesis-video-archived-media"); [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("KinesisVideoArchivedMedia")] public void GetClipMarshallTest() { var operation = service_model.FindOperation("GetClip"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetClipRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetClip", request, internalRequest, service_model); var webResponse = new WebResponseData { Headers = { {"Content-Type","Content-Type_Value"}, {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"} } }; var payloadResponse = new JsonSampleGenerator(service_model, operation.ResponseStructure).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, webResponse); ResponseUnmarshaller unmarshaller = GetClipResponseUnmarshaller.Instance; var response = unmarshaller.Unmarshall(context) as GetClipResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("KinesisVideoArchivedMedia")] public void GetClip_ClientLimitExceededExceptionMarshallTest() { var operation = service_model.FindOperation("GetClip"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetClipRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetClip", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ClientLimitExceededException")); var webResponse = new WebResponseData { Headers = { {"Content-Type","Content-Type_Value"}, {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ClientLimitExceededException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetClipResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("KinesisVideoArchivedMedia")] public void GetClip_InvalidArgumentExceptionMarshallTest() { var operation = service_model.FindOperation("GetClip"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetClipRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetClip", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("InvalidArgumentException")); var webResponse = new WebResponseData { Headers = { {"Content-Type","Content-Type_Value"}, {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InvalidArgumentException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetClipResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("KinesisVideoArchivedMedia")] public void GetClip_InvalidCodecPrivateDataExceptionMarshallTest() { var operation = service_model.FindOperation("GetClip"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetClipRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetClip", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("InvalidCodecPrivateDataException")); var webResponse = new WebResponseData { Headers = { {"Content-Type","Content-Type_Value"}, {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InvalidCodecPrivateDataException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetClipResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("KinesisVideoArchivedMedia")] public void GetClip_InvalidMediaFrameExceptionMarshallTest() { var operation = service_model.FindOperation("GetClip"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetClipRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetClip", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("InvalidMediaFrameException")); var webResponse = new WebResponseData { Headers = { {"Content-Type","Content-Type_Value"}, {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InvalidMediaFrameException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetClipResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("KinesisVideoArchivedMedia")] public void GetClip_MissingCodecPrivateDataExceptionMarshallTest() { var operation = service_model.FindOperation("GetClip"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetClipRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetClip", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("MissingCodecPrivateDataException")); var webResponse = new WebResponseData { Headers = { {"Content-Type","Content-Type_Value"}, {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","MissingCodecPrivateDataException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetClipResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("KinesisVideoArchivedMedia")] public void GetClip_NoDataRetentionExceptionMarshallTest() { var operation = service_model.FindOperation("GetClip"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetClipRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetClip", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("NoDataRetentionException")); var webResponse = new WebResponseData { Headers = { {"Content-Type","Content-Type_Value"}, {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","NoDataRetentionException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetClipResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("KinesisVideoArchivedMedia")] public void GetClip_NotAuthorizedExceptionMarshallTest() { var operation = service_model.FindOperation("GetClip"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetClipRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetClip", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("NotAuthorizedException")); var webResponse = new WebResponseData { Headers = { {"Content-Type","Content-Type_Value"}, {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","NotAuthorizedException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetClipResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("KinesisVideoArchivedMedia")] public void GetClip_ResourceNotFoundExceptionMarshallTest() { var operation = service_model.FindOperation("GetClip"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetClipRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetClip", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ResourceNotFoundException")); var webResponse = new WebResponseData { Headers = { {"Content-Type","Content-Type_Value"}, {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ResourceNotFoundException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetClipResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("KinesisVideoArchivedMedia")] public void GetClip_UnsupportedStreamMediaTypeExceptionMarshallTest() { var operation = service_model.FindOperation("GetClip"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetClipRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetClip", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("UnsupportedStreamMediaTypeException")); var webResponse = new WebResponseData { Headers = { {"Content-Type","Content-Type_Value"}, {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","UnsupportedStreamMediaTypeException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetClipResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("KinesisVideoArchivedMedia")] public void GetDASHStreamingSessionURLMarshallTest() { var operation = service_model.FindOperation("GetDASHStreamingSessionURL"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetDASHStreamingSessionURLRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetDASHStreamingSessionURL", request, internalRequest, service_model); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"} } }; var payloadResponse = new JsonSampleGenerator(service_model, operation.ResponseStructure).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, webResponse); ResponseUnmarshaller unmarshaller = GetDASHStreamingSessionURLResponseUnmarshaller.Instance; var response = unmarshaller.Unmarshall(context) as GetDASHStreamingSessionURLResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("KinesisVideoArchivedMedia")] public void GetDASHStreamingSessionURL_ClientLimitExceededExceptionMarshallTest() { var operation = service_model.FindOperation("GetDASHStreamingSessionURL"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetDASHStreamingSessionURLRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetDASHStreamingSessionURL", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ClientLimitExceededException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ClientLimitExceededException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetDASHStreamingSessionURLResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("KinesisVideoArchivedMedia")] public void GetDASHStreamingSessionURL_InvalidArgumentExceptionMarshallTest() { var operation = service_model.FindOperation("GetDASHStreamingSessionURL"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetDASHStreamingSessionURLRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetDASHStreamingSessionURL", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("InvalidArgumentException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InvalidArgumentException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetDASHStreamingSessionURLResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("KinesisVideoArchivedMedia")] public void GetDASHStreamingSessionURL_InvalidCodecPrivateDataExceptionMarshallTest() { var operation = service_model.FindOperation("GetDASHStreamingSessionURL"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetDASHStreamingSessionURLRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetDASHStreamingSessionURL", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("InvalidCodecPrivateDataException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InvalidCodecPrivateDataException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetDASHStreamingSessionURLResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("KinesisVideoArchivedMedia")] public void GetDASHStreamingSessionURL_MissingCodecPrivateDataExceptionMarshallTest() { var operation = service_model.FindOperation("GetDASHStreamingSessionURL"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetDASHStreamingSessionURLRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetDASHStreamingSessionURL", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("MissingCodecPrivateDataException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","MissingCodecPrivateDataException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetDASHStreamingSessionURLResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("KinesisVideoArchivedMedia")] public void GetDASHStreamingSessionURL_NoDataRetentionExceptionMarshallTest() { var operation = service_model.FindOperation("GetDASHStreamingSessionURL"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetDASHStreamingSessionURLRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetDASHStreamingSessionURL", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("NoDataRetentionException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","NoDataRetentionException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetDASHStreamingSessionURLResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("KinesisVideoArchivedMedia")] public void GetDASHStreamingSessionURL_NotAuthorizedExceptionMarshallTest() { var operation = service_model.FindOperation("GetDASHStreamingSessionURL"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetDASHStreamingSessionURLRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetDASHStreamingSessionURL", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("NotAuthorizedException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","NotAuthorizedException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetDASHStreamingSessionURLResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("KinesisVideoArchivedMedia")] public void GetDASHStreamingSessionURL_ResourceNotFoundExceptionMarshallTest() { var operation = service_model.FindOperation("GetDASHStreamingSessionURL"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetDASHStreamingSessionURLRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetDASHStreamingSessionURL", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ResourceNotFoundException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ResourceNotFoundException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetDASHStreamingSessionURLResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("KinesisVideoArchivedMedia")] public void GetDASHStreamingSessionURL_UnsupportedStreamMediaTypeExceptionMarshallTest() { var operation = service_model.FindOperation("GetDASHStreamingSessionURL"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetDASHStreamingSessionURLRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetDASHStreamingSessionURL", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("UnsupportedStreamMediaTypeException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","UnsupportedStreamMediaTypeException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetDASHStreamingSessionURLResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("KinesisVideoArchivedMedia")] public void GetHLSStreamingSessionURLMarshallTest() { var operation = service_model.FindOperation("GetHLSStreamingSessionURL"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetHLSStreamingSessionURLRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetHLSStreamingSessionURL", request, internalRequest, service_model); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"} } }; var payloadResponse = new JsonSampleGenerator(service_model, operation.ResponseStructure).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, webResponse); ResponseUnmarshaller unmarshaller = GetHLSStreamingSessionURLResponseUnmarshaller.Instance; var response = unmarshaller.Unmarshall(context) as GetHLSStreamingSessionURLResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("KinesisVideoArchivedMedia")] public void GetHLSStreamingSessionURL_ClientLimitExceededExceptionMarshallTest() { var operation = service_model.FindOperation("GetHLSStreamingSessionURL"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetHLSStreamingSessionURLRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetHLSStreamingSessionURL", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ClientLimitExceededException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ClientLimitExceededException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetHLSStreamingSessionURLResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("KinesisVideoArchivedMedia")] public void GetHLSStreamingSessionURL_InvalidArgumentExceptionMarshallTest() { var operation = service_model.FindOperation("GetHLSStreamingSessionURL"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetHLSStreamingSessionURLRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetHLSStreamingSessionURL", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("InvalidArgumentException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InvalidArgumentException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetHLSStreamingSessionURLResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("KinesisVideoArchivedMedia")] public void GetHLSStreamingSessionURL_InvalidCodecPrivateDataExceptionMarshallTest() { var operation = service_model.FindOperation("GetHLSStreamingSessionURL"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetHLSStreamingSessionURLRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetHLSStreamingSessionURL", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("InvalidCodecPrivateDataException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InvalidCodecPrivateDataException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetHLSStreamingSessionURLResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("KinesisVideoArchivedMedia")] public void GetHLSStreamingSessionURL_MissingCodecPrivateDataExceptionMarshallTest() { var operation = service_model.FindOperation("GetHLSStreamingSessionURL"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetHLSStreamingSessionURLRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetHLSStreamingSessionURL", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("MissingCodecPrivateDataException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","MissingCodecPrivateDataException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetHLSStreamingSessionURLResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("KinesisVideoArchivedMedia")] public void GetHLSStreamingSessionURL_NoDataRetentionExceptionMarshallTest() { var operation = service_model.FindOperation("GetHLSStreamingSessionURL"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetHLSStreamingSessionURLRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetHLSStreamingSessionURL", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("NoDataRetentionException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","NoDataRetentionException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetHLSStreamingSessionURLResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("KinesisVideoArchivedMedia")] public void GetHLSStreamingSessionURL_NotAuthorizedExceptionMarshallTest() { var operation = service_model.FindOperation("GetHLSStreamingSessionURL"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetHLSStreamingSessionURLRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetHLSStreamingSessionURL", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("NotAuthorizedException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","NotAuthorizedException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetHLSStreamingSessionURLResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("KinesisVideoArchivedMedia")] public void GetHLSStreamingSessionURL_ResourceNotFoundExceptionMarshallTest() { var operation = service_model.FindOperation("GetHLSStreamingSessionURL"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetHLSStreamingSessionURLRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetHLSStreamingSessionURL", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ResourceNotFoundException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ResourceNotFoundException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetHLSStreamingSessionURLResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("KinesisVideoArchivedMedia")] public void GetHLSStreamingSessionURL_UnsupportedStreamMediaTypeExceptionMarshallTest() { var operation = service_model.FindOperation("GetHLSStreamingSessionURL"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetHLSStreamingSessionURLRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetHLSStreamingSessionURL", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("UnsupportedStreamMediaTypeException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","UnsupportedStreamMediaTypeException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetHLSStreamingSessionURLResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("KinesisVideoArchivedMedia")] public void GetImagesMarshallTest() { var operation = service_model.FindOperation("GetImages"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetImagesRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetImages", request, internalRequest, service_model); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"} } }; var payloadResponse = new JsonSampleGenerator(service_model, operation.ResponseStructure).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, webResponse); ResponseUnmarshaller unmarshaller = GetImagesResponseUnmarshaller.Instance; var response = unmarshaller.Unmarshall(context) as GetImagesResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("KinesisVideoArchivedMedia")] public void GetImages_ClientLimitExceededExceptionMarshallTest() { var operation = service_model.FindOperation("GetImages"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetImagesRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetImages", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ClientLimitExceededException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ClientLimitExceededException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetImagesResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("KinesisVideoArchivedMedia")] public void GetImages_InvalidArgumentExceptionMarshallTest() { var operation = service_model.FindOperation("GetImages"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetImagesRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetImages", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("InvalidArgumentException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InvalidArgumentException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetImagesResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("KinesisVideoArchivedMedia")] public void GetImages_NotAuthorizedExceptionMarshallTest() { var operation = service_model.FindOperation("GetImages"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetImagesRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetImages", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("NotAuthorizedException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","NotAuthorizedException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetImagesResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("KinesisVideoArchivedMedia")] public void GetImages_ResourceNotFoundExceptionMarshallTest() { var operation = service_model.FindOperation("GetImages"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetImagesRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetImages", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ResourceNotFoundException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ResourceNotFoundException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetImagesResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("KinesisVideoArchivedMedia")] public void GetMediaForFragmentListMarshallTest() { var operation = service_model.FindOperation("GetMediaForFragmentList"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetMediaForFragmentListRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetMediaForFragmentList", request, internalRequest, service_model); var webResponse = new WebResponseData { Headers = { {"Content-Type","Content-Type_Value"}, {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"} } }; var payloadResponse = new JsonSampleGenerator(service_model, operation.ResponseStructure).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, webResponse); ResponseUnmarshaller unmarshaller = GetMediaForFragmentListResponseUnmarshaller.Instance; var response = unmarshaller.Unmarshall(context) as GetMediaForFragmentListResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("KinesisVideoArchivedMedia")] public void GetMediaForFragmentList_ClientLimitExceededExceptionMarshallTest() { var operation = service_model.FindOperation("GetMediaForFragmentList"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetMediaForFragmentListRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetMediaForFragmentList", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ClientLimitExceededException")); var webResponse = new WebResponseData { Headers = { {"Content-Type","Content-Type_Value"}, {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ClientLimitExceededException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetMediaForFragmentListResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("KinesisVideoArchivedMedia")] public void GetMediaForFragmentList_InvalidArgumentExceptionMarshallTest() { var operation = service_model.FindOperation("GetMediaForFragmentList"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetMediaForFragmentListRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetMediaForFragmentList", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("InvalidArgumentException")); var webResponse = new WebResponseData { Headers = { {"Content-Type","Content-Type_Value"}, {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InvalidArgumentException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetMediaForFragmentListResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("KinesisVideoArchivedMedia")] public void GetMediaForFragmentList_NotAuthorizedExceptionMarshallTest() { var operation = service_model.FindOperation("GetMediaForFragmentList"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetMediaForFragmentListRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetMediaForFragmentList", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("NotAuthorizedException")); var webResponse = new WebResponseData { Headers = { {"Content-Type","Content-Type_Value"}, {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","NotAuthorizedException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetMediaForFragmentListResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("KinesisVideoArchivedMedia")] public void GetMediaForFragmentList_ResourceNotFoundExceptionMarshallTest() { var operation = service_model.FindOperation("GetMediaForFragmentList"); var request = InstantiateClassGenerator.Execute(); var marshaller = new GetMediaForFragmentListRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("GetMediaForFragmentList", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ResourceNotFoundException")); var webResponse = new WebResponseData { Headers = { {"Content-Type","Content-Type_Value"}, {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ResourceNotFoundException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = GetMediaForFragmentListResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("KinesisVideoArchivedMedia")] public void ListFragmentsMarshallTest() { var operation = service_model.FindOperation("ListFragments"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListFragmentsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("ListFragments", request, internalRequest, service_model); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"} } }; var payloadResponse = new JsonSampleGenerator(service_model, operation.ResponseStructure).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, webResponse); ResponseUnmarshaller unmarshaller = ListFragmentsResponseUnmarshaller.Instance; var response = unmarshaller.Unmarshall(context) as ListFragmentsResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("KinesisVideoArchivedMedia")] public void ListFragments_ClientLimitExceededExceptionMarshallTest() { var operation = service_model.FindOperation("ListFragments"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListFragmentsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("ListFragments", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ClientLimitExceededException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ClientLimitExceededException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = ListFragmentsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("KinesisVideoArchivedMedia")] public void ListFragments_InvalidArgumentExceptionMarshallTest() { var operation = service_model.FindOperation("ListFragments"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListFragmentsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("ListFragments", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("InvalidArgumentException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","InvalidArgumentException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = ListFragmentsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("KinesisVideoArchivedMedia")] public void ListFragments_NotAuthorizedExceptionMarshallTest() { var operation = service_model.FindOperation("ListFragments"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListFragmentsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("ListFragments", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("NotAuthorizedException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","NotAuthorizedException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = ListFragmentsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } [TestMethod] [TestCategory("UnitTest")] [TestCategory("Rest_Json")] [TestCategory("KinesisVideoArchivedMedia")] public void ListFragments_ResourceNotFoundExceptionMarshallTest() { var operation = service_model.FindOperation("ListFragments"); var request = InstantiateClassGenerator.Execute(); var marshaller = new ListFragmentsRequestMarshaller(); var internalRequest = marshaller.Marshall(request); TestTools.RequestValidator.Validate("ListFragments", request, internalRequest, service_model); var exception = operation.Exceptions.First(e => e.Name.Equals("ResourceNotFoundException")); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"}, {"x-amzn-ErrorType","ResourceNotFoundException"}, } }; var payloadResponse = new JsonSampleGenerator(service_model, exception).Execute(); webResponse.Headers["Content-Length"] = UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString(); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), true, webResponse, true); var response = ListFragmentsResponseUnmarshaller.Instance.UnmarshallException(context, null, System.Net.HttpStatusCode.OK); InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); } } }