public void State_Serializer_Auto() { Mock <IXmlSerializerImportOptionsBuilder> xmlSerializerImportOptionsBuilder = CreateXmlSerializerImportOptionsBuilder(); Mock <IXsdDataContractImporterBuilder> xsdDataContractImporterBuilder = CreateXsdDataContractImporterBuilder(); Mock <IWrappedOptionsBuilder> wrappedOptionsBuilder = CreateWrappedOptionsBuilder(); Mock <IFaultImportOptionsBuilder> faultImportOptionsBuilder = CreateFaultImportOptionsBuilder(); CodeGeneratorOptions options = new CodeGeneratorOptions { Serializer = SerializerMode.Auto }; WsdlImporter wsdlImporter = GetWsdlImporter(options, xmlSerializerImportOptionsBuilder, xsdDataContractImporterBuilder, wrappedOptionsBuilder, faultImportOptionsBuilder); XsdDataContractImporter dataContractImporterState = GetState <XsdDataContractImporter>(wsdlImporter); Assert.That(dataContractImporterState, Is.EqualTo(xsdDataContractImporter)); XmlSerializerImportOptions xmlSerializerState = GetState <XmlSerializerImportOptions>(wsdlImporter); Assert.That(xmlSerializerState, Is.EqualTo(xmlSerializerImportOptions)); WrappedOptions wrappedOptionsState = GetState <WrappedOptions>(wsdlImporter); Assert.That(wrappedOptionsState, Is.EqualTo(wrappedOptions)); FaultImportOptions faultImportOptionsState = GetState <FaultImportOptions>(wsdlImporter); Assert.That(faultImportOptionsState, Is.EqualTo(faultImportOptions)); VerifyXmlSerializerImportOptionsBuilder(xmlSerializerImportOptionsBuilder, Times.Once()); VerifyXsdDataContractImporterBuilder(xsdDataContractImporterBuilder, Times.Once()); VerifyWrappedOptionsBuilder(wrappedOptionsBuilder, Times.Exactly(2)); VerifyFaultImportOptionsBuilder(faultImportOptionsBuilder, Times.Once()); }
public void UseMessageFormatIsAlwaysTrue() { IFaultImportOptionsBuilder builder = new FaultImportOptionsBuilder(); FaultImportOptions faultImportOptions = builder.Build(); Assert.That(faultImportOptions.UseMessageFormat, Is.True); }
private void AddFaultImportOptions() { FaultImportOptions faultImportOptions = new FaultImportOptions { UseMessageFormat = true }; wsdlImporter.State.Add(typeof(FaultImportOptions), faultImportOptions); }
private void AddStateForFaultSerializerImport(WsdlImporter importer) { var faultImportOptions = new FaultImportOptions(); faultImportOptions.UseMessageFormat = true; importer.State.Add(typeof(FaultImportOptions), faultImportOptions); }