<#@ template language="C#" inherits="Generators.BaseGenerator"#> <#@ assembly name="System.Core" #> <#@ import namespace="System.IO" #> <#@ import namespace="System.Linq" #> <#@ import namespace="System.Text" #> <#@ import namespace="System.Collections.Generic" #> <# AddLicenseHeader(); #> using System; using System.IO; using System.Text; using Microsoft.VisualStudio.TestTools.UnitTesting; using <#=this.Config.Namespace#>; using <#=this.Config.Namespace#>.Model; using <#=this.Config.Namespace#>.Model.Internal.MarshallTransformations; using Amazon.Runtime.Internal.Transform; using ServiceClientGenerator; using ServiceClientGenerator.Generators.SourceFiles; using AWSSDK_DotNet35.UnitTests.TestTools; namespace AWSSDK_DotNet35.UnitTests.Marshalling { [TestClass] public class <#=this.Config.ClassName#>MarshallingTests { static readonly ServiceModel service_model = Utils.LoadServiceModel("<#= this.Config.ServiceDirectoryName #>"); <# foreach(var operation in this.Config.ServiceModel.Operations) { #> [TestMethod] [TestCategory("UnitTest")] [TestCategory("Query")] [TestCategory("<#=this.Config.TestCategory#>")] public void <#=operation.Name#>MarshallTest() { var operation = service_model.FindOperation("<#=operation.Name#>"); var request = InstantiateClassGenerator.Execute<<#=operation.Name#>Request>(); var marshaller = new <#=operation.Name#>RequestMarshaller(); var internalRequest = marshaller.Marshall(request); var validator = new AWSQueryValidator(internalRequest.Parameters, request, service_model, operation); validator.Validate(); <# if(operation.ResponseStructure != null) { #> var payloadResponse = new XmlSampleGenerator(service_model, operation).Execute(); UnmarshallerContext context = new EC2UnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, new WebResponseData()); var response = <#=operation.Name#>ResponseUnmarshaller.Instance.Unmarshall(context) as <#=operation.Name#>Response; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); <# } #> } <# } #> } }