private Message CreateMessageContract()
        {
            Message messageContract = Store.ElementFactory.CreateElement(Message.DomainClassId) as Message;
            WCFMessageContract wcfMessageContract = new WCFMessageContract();

            wcfMessageContract.IsWrapped = false;
            messageContract.Name = "foo";
            messageContract.ObjectExtender = wcfMessageContract;

            return messageContract;
        }
		public void ShouldGenerateCorrectXmlSerializerAttributes()
		{
			ProjectMappingManagerSetup.InitializeManager(ServiceProvider, "ProjectMapping.ServiceContractDsl.Tests.xml");
			Message rootElement = CreateRoot<Message>(MessageContractElementName, MessageContractElementNamespace);
			rootElement.ServiceContractModel.ProjectMappingTable = "WCF";
			PrimitiveMessagePart primitivePart = new PrimitiveMessagePart(Store);
			primitivePart.Name = "TestProperty";
			primitivePart.Type = typeof(System.String).ToString();
			rootElement.MessageParts.Add(primitivePart);
			WCFMessageContract wcfMc = new WCFMessageContract(true);
			wcfMc.ModelElement = rootElement;
			rootElement.ObjectExtender = wcfMc;
			
			string content = RunTemplate(rootElement);

			Type generatedType = CompileAndGetType(content);
			TypeAsserter.AssertAttribute<XmlSerializerFormatAttribute>(generatedType);
			PropertyInfo property = generatedType.GetProperty(primitivePart.Name);
			TypeAsserter.AssertAttribute<XmlElementAttribute>(property);
		}