From 3a4bd135cf7cfdaeb06dc60ce05787cffa7de4d7 Mon Sep 17 00:00:00 2001 From: Carol Wang Date: Mon, 22 Dec 2025 17:11:05 +0800 Subject: [PATCH] [dotnet-svcutil] Expand --collectionType tests to cover issue 5869. --- .../GenericBaseline/GenericBaseline.csproj | 14 + .../ServiceReference/Reference.cs | 235 +++++++++++++++++ .../dotnet-svcutil.params.json | 19 ++ .../GenericSortedDict.csproj | 14 + .../ServiceReference/Reference.cs | 235 +++++++++++++++++ .../dotnet-svcutil.params.json | 19 ++ .../GenericSortedList.csproj | 14 + .../ServiceReference/Reference.cs | 235 +++++++++++++++++ .../dotnet-svcutil.params.json | 19 ++ .../HybridDictionary/HybridDictionary.csproj | 14 + .../ServiceReference/Reference.cs | 235 +++++++++++++++++ .../dotnet-svcutil.params.json | 19 ++ .../LegacyNonGeneric/LegacyNonGeneric.csproj | 14 + .../ServiceReference/Reference.cs | 235 +++++++++++++++++ .../dotnet-svcutil.params.json | 19 ++ .../ListDictionary/ListDictionary.csproj | 14 + .../ServiceReference/Reference.cs | 235 +++++++++++++++++ .../dotnet-svcutil.params.json | 19 ++ .../NonGenericSortedDict.csproj | 14 + .../ServiceReference/Reference.cs | 235 +++++++++++++++++ .../dotnet-svcutil.params.json | 19 ++ .../ObjectModelOrderedDict.csproj | 14 + .../ServiceReference/Reference.cs | 235 +++++++++++++++++ .../dotnet-svcutil.params.json | 19 ++ .../SvcutilBootstrapper.csproj | 6 +- .../SvcutilBootstrapper.csproj | 6 +- .../SvcutilBootstrapper.csproj | 6 +- .../SvcutilBootstrapper.csproj | 6 +- .../SvcutilBootstrapper.csproj | 6 +- .../SvcutilBootstrapper.csproj | 6 +- .../tests/TestCases/wsdl/CollectionTypes.wsdl | 244 ++++++++++++++++++ .../lib/tests/src/GlobalToolTests.cs | 22 ++ 32 files changed, 2428 insertions(+), 18 deletions(-) create mode 100644 src/dotnet-svcutil/lib/tests/Baselines/CollectionTypeOptionTests/GenericBaseline/GenericBaseline.csproj create mode 100644 src/dotnet-svcutil/lib/tests/Baselines/CollectionTypeOptionTests/GenericBaseline/ServiceReference/Reference.cs create mode 100644 src/dotnet-svcutil/lib/tests/Baselines/CollectionTypeOptionTests/GenericBaseline/ServiceReference/dotnet-svcutil.params.json create mode 100644 src/dotnet-svcutil/lib/tests/Baselines/CollectionTypeOptionTests/GenericSortedDict/GenericSortedDict.csproj create mode 100644 src/dotnet-svcutil/lib/tests/Baselines/CollectionTypeOptionTests/GenericSortedDict/ServiceReference/Reference.cs create mode 100644 src/dotnet-svcutil/lib/tests/Baselines/CollectionTypeOptionTests/GenericSortedDict/ServiceReference/dotnet-svcutil.params.json create mode 100644 src/dotnet-svcutil/lib/tests/Baselines/CollectionTypeOptionTests/GenericSortedList/GenericSortedList.csproj create mode 100644 src/dotnet-svcutil/lib/tests/Baselines/CollectionTypeOptionTests/GenericSortedList/ServiceReference/Reference.cs create mode 100644 src/dotnet-svcutil/lib/tests/Baselines/CollectionTypeOptionTests/GenericSortedList/ServiceReference/dotnet-svcutil.params.json create mode 100644 src/dotnet-svcutil/lib/tests/Baselines/CollectionTypeOptionTests/HybridDictionary/HybridDictionary.csproj create mode 100644 src/dotnet-svcutil/lib/tests/Baselines/CollectionTypeOptionTests/HybridDictionary/ServiceReference/Reference.cs create mode 100644 src/dotnet-svcutil/lib/tests/Baselines/CollectionTypeOptionTests/HybridDictionary/ServiceReference/dotnet-svcutil.params.json create mode 100644 src/dotnet-svcutil/lib/tests/Baselines/CollectionTypeOptionTests/LegacyNonGeneric/LegacyNonGeneric.csproj create mode 100644 src/dotnet-svcutil/lib/tests/Baselines/CollectionTypeOptionTests/LegacyNonGeneric/ServiceReference/Reference.cs create mode 100644 src/dotnet-svcutil/lib/tests/Baselines/CollectionTypeOptionTests/LegacyNonGeneric/ServiceReference/dotnet-svcutil.params.json create mode 100644 src/dotnet-svcutil/lib/tests/Baselines/CollectionTypeOptionTests/ListDictionary/ListDictionary.csproj create mode 100644 src/dotnet-svcutil/lib/tests/Baselines/CollectionTypeOptionTests/ListDictionary/ServiceReference/Reference.cs create mode 100644 src/dotnet-svcutil/lib/tests/Baselines/CollectionTypeOptionTests/ListDictionary/ServiceReference/dotnet-svcutil.params.json create mode 100644 src/dotnet-svcutil/lib/tests/Baselines/CollectionTypeOptionTests/NonGenericSortedDict/NonGenericSortedDict.csproj create mode 100644 src/dotnet-svcutil/lib/tests/Baselines/CollectionTypeOptionTests/NonGenericSortedDict/ServiceReference/Reference.cs create mode 100644 src/dotnet-svcutil/lib/tests/Baselines/CollectionTypeOptionTests/NonGenericSortedDict/ServiceReference/dotnet-svcutil.params.json create mode 100644 src/dotnet-svcutil/lib/tests/Baselines/CollectionTypeOptionTests/ObjectModelOrderedDict/ObjectModelOrderedDict.csproj create mode 100644 src/dotnet-svcutil/lib/tests/Baselines/CollectionTypeOptionTests/ObjectModelOrderedDict/ServiceReference/Reference.cs create mode 100644 src/dotnet-svcutil/lib/tests/Baselines/CollectionTypeOptionTests/ObjectModelOrderedDict/ServiceReference/dotnet-svcutil.params.json create mode 100644 src/dotnet-svcutil/lib/tests/TestCases/wsdl/CollectionTypes.wsdl diff --git a/src/dotnet-svcutil/lib/tests/Baselines/CollectionTypeOptionTests/GenericBaseline/GenericBaseline.csproj b/src/dotnet-svcutil/lib/tests/Baselines/CollectionTypeOptionTests/GenericBaseline/GenericBaseline.csproj new file mode 100644 index 00000000000..c2d91e178fd --- /dev/null +++ b/src/dotnet-svcutil/lib/tests/Baselines/CollectionTypeOptionTests/GenericBaseline/GenericBaseline.csproj @@ -0,0 +1,14 @@ + + + + Exe + N.N + enable + enable + + + + + + + \ No newline at end of file diff --git a/src/dotnet-svcutil/lib/tests/Baselines/CollectionTypeOptionTests/GenericBaseline/ServiceReference/Reference.cs b/src/dotnet-svcutil/lib/tests/Baselines/CollectionTypeOptionTests/GenericBaseline/ServiceReference/Reference.cs new file mode 100644 index 00000000000..17e9ae77805 --- /dev/null +++ b/src/dotnet-svcutil/lib/tests/Baselines/CollectionTypeOptionTests/GenericBaseline/ServiceReference/Reference.cs @@ -0,0 +1,235 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace GenericBaseline_NS +{ + using System.Runtime.Serialization; + + + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "99.99.99")] + [System.Runtime.Serialization.DataContractAttribute(Name="CollectionContainer", Namespace="http://schemas.datacontract.org/2004/07/CollectionTestService")] + public partial class CollectionContainer : object + { + + private System.Collections.Generic.List NamesField; + + private System.Collections.Generic.List NumbersField; + + private System.Collections.Generic.List ValuesField; + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Collections.Generic.List Names + { + get + { + return this.NamesField; + } + set + { + this.NamesField = value; + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Collections.Generic.List Numbers + { + get + { + return this.NumbersField; + } + set + { + this.NumbersField = value; + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Collections.Generic.List Values + { + get + { + return this.ValuesField; + } + set + { + this.ValuesField = value; + } + } + } + + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "99.99.99")] + [System.Runtime.Serialization.DataContractAttribute(Name="DictionaryContainer", Namespace="http://schemas.datacontract.org/2004/07/CollectionTestService")] + public partial class DictionaryContainer : object + { + + private System.Collections.Generic.Dictionary ReverseLookupField; + + private System.Collections.Generic.Dictionary ScoresField; + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Collections.Generic.Dictionary ReverseLookup + { + get + { + return this.ReverseLookupField; + } + set + { + this.ReverseLookupField = value; + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Collections.Generic.Dictionary Scores + { + get + { + return this.ScoresField; + } + set + { + this.ScoresField = value; + } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "99.99.99")] + [System.ServiceModel.ServiceContractAttribute(ConfigurationName="GenericBaseline_NS.IService1")] + public interface IService1 + { + + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IService1/GetCollections", ReplyAction="http://tempuri.org/IService1/GetCollectionsResponse")] + System.Threading.Tasks.Task GetCollectionsAsync(); + + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IService1/GetDictionaries", ReplyAction="http://tempuri.org/IService1/GetDictionariesResponse")] + System.Threading.Tasks.Task GetDictionariesAsync(); + + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IService1/GetOrderedDictionary", ReplyAction="http://tempuri.org/IService1/GetOrderedDictionaryResponse")] + System.Threading.Tasks.Task> GetOrderedDictionaryAsync(); + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "99.99.99")] + public interface IService1Channel : GenericBaseline_NS.IService1, System.ServiceModel.IClientChannel + { + } + + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "99.99.99")] + public partial class Service1Client : System.ServiceModel.ClientBase, GenericBaseline_NS.IService1 + { + + /// + /// Implement this partial method to configure the service endpoint. + /// + /// The endpoint to configure + /// The client credentials + static partial void ConfigureEndpoint(System.ServiceModel.Description.ServiceEndpoint serviceEndpoint, System.ServiceModel.Description.ClientCredentials clientCredentials); + + public Service1Client() : + base(Service1Client.GetDefaultBinding(), Service1Client.GetDefaultEndpointAddress()) + { + this.Endpoint.Name = EndpointConfiguration.BasicHttpBinding_IService1.ToString(); + ConfigureEndpoint(this.Endpoint, this.ClientCredentials); + } + + public Service1Client(EndpointConfiguration endpointConfiguration) : + base(Service1Client.GetBindingForEndpoint(endpointConfiguration), Service1Client.GetEndpointAddress(endpointConfiguration)) + { + this.Endpoint.Name = endpointConfiguration.ToString(); + ConfigureEndpoint(this.Endpoint, this.ClientCredentials); + } + + public Service1Client(EndpointConfiguration endpointConfiguration, string remoteAddress) : + base(Service1Client.GetBindingForEndpoint(endpointConfiguration), new System.ServiceModel.EndpointAddress(remoteAddress)) + { + this.Endpoint.Name = endpointConfiguration.ToString(); + ConfigureEndpoint(this.Endpoint, this.ClientCredentials); + } + + public Service1Client(EndpointConfiguration endpointConfiguration, System.ServiceModel.EndpointAddress remoteAddress) : + base(Service1Client.GetBindingForEndpoint(endpointConfiguration), remoteAddress) + { + this.Endpoint.Name = endpointConfiguration.ToString(); + ConfigureEndpoint(this.Endpoint, this.ClientCredentials); + } + + public Service1Client(System.ServiceModel.Channels.Binding binding, System.ServiceModel.EndpointAddress remoteAddress) : + base(binding, remoteAddress) + { + } + + public System.Threading.Tasks.Task GetCollectionsAsync() + { + return base.Channel.GetCollectionsAsync(); + } + + public System.Threading.Tasks.Task GetDictionariesAsync() + { + return base.Channel.GetDictionariesAsync(); + } + + public System.Threading.Tasks.Task> GetOrderedDictionaryAsync() + { + return base.Channel.GetOrderedDictionaryAsync(); + } + + public virtual System.Threading.Tasks.Task OpenAsync() + { + return System.Threading.Tasks.Task.Factory.FromAsync(((System.ServiceModel.ICommunicationObject)(this)).BeginOpen(null, null), new System.Action(((System.ServiceModel.ICommunicationObject)(this)).EndOpen)); + } + + #if !NET6_0_OR_GREATER + public virtual System.Threading.Tasks.Task CloseAsync() + { + return System.Threading.Tasks.Task.Factory.FromAsync(((System.ServiceModel.ICommunicationObject)(this)).BeginClose(null, null), new System.Action(((System.ServiceModel.ICommunicationObject)(this)).EndClose)); + } + #endif + + private static System.ServiceModel.Channels.Binding GetBindingForEndpoint(EndpointConfiguration endpointConfiguration) + { + if ((endpointConfiguration == EndpointConfiguration.BasicHttpBinding_IService1)) + { + System.ServiceModel.BasicHttpBinding result = new System.ServiceModel.BasicHttpBinding(); + result.MaxBufferSize = int.MaxValue; + result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max; + result.MaxReceivedMessageSize = int.MaxValue; + result.AllowCookies = true; + return result; + } + throw new System.InvalidOperationException(string.Format("Could not find endpoint with name \'{0}\'.", endpointConfiguration)); + } + + private static System.ServiceModel.EndpointAddress GetEndpointAddress(EndpointConfiguration endpointConfiguration) + { + if ((endpointConfiguration == EndpointConfiguration.BasicHttpBinding_IService1)) + { + return new System.ServiceModel.EndpointAddress("http://localhost:49773/Service1.svc"); + } + throw new System.InvalidOperationException(string.Format("Could not find endpoint with name \'{0}\'.", endpointConfiguration)); + } + + private static System.ServiceModel.Channels.Binding GetDefaultBinding() + { + return Service1Client.GetBindingForEndpoint(EndpointConfiguration.BasicHttpBinding_IService1); + } + + private static System.ServiceModel.EndpointAddress GetDefaultEndpointAddress() + { + return Service1Client.GetEndpointAddress(EndpointConfiguration.BasicHttpBinding_IService1); + } + + public enum EndpointConfiguration + { + + BasicHttpBinding_IService1, + } + } +} \ No newline at end of file diff --git a/src/dotnet-svcutil/lib/tests/Baselines/CollectionTypeOptionTests/GenericBaseline/ServiceReference/dotnet-svcutil.params.json b/src/dotnet-svcutil/lib/tests/Baselines/CollectionTypeOptionTests/GenericBaseline/ServiceReference/dotnet-svcutil.params.json new file mode 100644 index 00000000000..6826cf493c3 --- /dev/null +++ b/src/dotnet-svcutil/lib/tests/Baselines/CollectionTypeOptionTests/GenericBaseline/ServiceReference/dotnet-svcutil.params.json @@ -0,0 +1,19 @@ +{ + "providerId": "Microsoft.Tools.ServiceModel.Svcutil", + "version": "99.99.99", + "options": { + "inputs": [ + "../../../../../../src/dotnet-svcutil/lib/tests/TestCases/wsdl/CollectionTypes.wsdl" + ], + "collectionTypes": [ + "System.Collections.Generic.Dictionary`2", + "System.Collections.Generic.List`1" + ], + "namespaceMappings": [ + "*, GenericBaseline_NS" + ], + "outputFile": "Reference.cs", + "targetFramework": "N.N", + "typeReuseMode": "All" + } +} \ No newline at end of file diff --git a/src/dotnet-svcutil/lib/tests/Baselines/CollectionTypeOptionTests/GenericSortedDict/GenericSortedDict.csproj b/src/dotnet-svcutil/lib/tests/Baselines/CollectionTypeOptionTests/GenericSortedDict/GenericSortedDict.csproj new file mode 100644 index 00000000000..c2d91e178fd --- /dev/null +++ b/src/dotnet-svcutil/lib/tests/Baselines/CollectionTypeOptionTests/GenericSortedDict/GenericSortedDict.csproj @@ -0,0 +1,14 @@ + + + + Exe + N.N + enable + enable + + + + + + + \ No newline at end of file diff --git a/src/dotnet-svcutil/lib/tests/Baselines/CollectionTypeOptionTests/GenericSortedDict/ServiceReference/Reference.cs b/src/dotnet-svcutil/lib/tests/Baselines/CollectionTypeOptionTests/GenericSortedDict/ServiceReference/Reference.cs new file mode 100644 index 00000000000..a0793bf8d5b --- /dev/null +++ b/src/dotnet-svcutil/lib/tests/Baselines/CollectionTypeOptionTests/GenericSortedDict/ServiceReference/Reference.cs @@ -0,0 +1,235 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace GenericSortedDict_NS +{ + using System.Runtime.Serialization; + + + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "99.99.99")] + [System.Runtime.Serialization.DataContractAttribute(Name="CollectionContainer", Namespace="http://schemas.datacontract.org/2004/07/CollectionTestService")] + public partial class CollectionContainer : object + { + + private System.Collections.Generic.LinkedList NamesField; + + private System.Collections.Generic.LinkedList NumbersField; + + private System.Collections.Generic.LinkedList ValuesField; + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Collections.Generic.LinkedList Names + { + get + { + return this.NamesField; + } + set + { + this.NamesField = value; + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Collections.Generic.LinkedList Numbers + { + get + { + return this.NumbersField; + } + set + { + this.NumbersField = value; + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Collections.Generic.LinkedList Values + { + get + { + return this.ValuesField; + } + set + { + this.ValuesField = value; + } + } + } + + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "99.99.99")] + [System.Runtime.Serialization.DataContractAttribute(Name="DictionaryContainer", Namespace="http://schemas.datacontract.org/2004/07/CollectionTestService")] + public partial class DictionaryContainer : object + { + + private System.Collections.Generic.SortedDictionary ReverseLookupField; + + private System.Collections.Generic.SortedDictionary ScoresField; + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Collections.Generic.SortedDictionary ReverseLookup + { + get + { + return this.ReverseLookupField; + } + set + { + this.ReverseLookupField = value; + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Collections.Generic.SortedDictionary Scores + { + get + { + return this.ScoresField; + } + set + { + this.ScoresField = value; + } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "99.99.99")] + [System.ServiceModel.ServiceContractAttribute(ConfigurationName="GenericSortedDict_NS.IService1")] + public interface IService1 + { + + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IService1/GetCollections", ReplyAction="http://tempuri.org/IService1/GetCollectionsResponse")] + System.Threading.Tasks.Task GetCollectionsAsync(); + + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IService1/GetDictionaries", ReplyAction="http://tempuri.org/IService1/GetDictionariesResponse")] + System.Threading.Tasks.Task GetDictionariesAsync(); + + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IService1/GetOrderedDictionary", ReplyAction="http://tempuri.org/IService1/GetOrderedDictionaryResponse")] + System.Threading.Tasks.Task> GetOrderedDictionaryAsync(); + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "99.99.99")] + public interface IService1Channel : GenericSortedDict_NS.IService1, System.ServiceModel.IClientChannel + { + } + + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "99.99.99")] + public partial class Service1Client : System.ServiceModel.ClientBase, GenericSortedDict_NS.IService1 + { + + /// + /// Implement this partial method to configure the service endpoint. + /// + /// The endpoint to configure + /// The client credentials + static partial void ConfigureEndpoint(System.ServiceModel.Description.ServiceEndpoint serviceEndpoint, System.ServiceModel.Description.ClientCredentials clientCredentials); + + public Service1Client() : + base(Service1Client.GetDefaultBinding(), Service1Client.GetDefaultEndpointAddress()) + { + this.Endpoint.Name = EndpointConfiguration.BasicHttpBinding_IService1.ToString(); + ConfigureEndpoint(this.Endpoint, this.ClientCredentials); + } + + public Service1Client(EndpointConfiguration endpointConfiguration) : + base(Service1Client.GetBindingForEndpoint(endpointConfiguration), Service1Client.GetEndpointAddress(endpointConfiguration)) + { + this.Endpoint.Name = endpointConfiguration.ToString(); + ConfigureEndpoint(this.Endpoint, this.ClientCredentials); + } + + public Service1Client(EndpointConfiguration endpointConfiguration, string remoteAddress) : + base(Service1Client.GetBindingForEndpoint(endpointConfiguration), new System.ServiceModel.EndpointAddress(remoteAddress)) + { + this.Endpoint.Name = endpointConfiguration.ToString(); + ConfigureEndpoint(this.Endpoint, this.ClientCredentials); + } + + public Service1Client(EndpointConfiguration endpointConfiguration, System.ServiceModel.EndpointAddress remoteAddress) : + base(Service1Client.GetBindingForEndpoint(endpointConfiguration), remoteAddress) + { + this.Endpoint.Name = endpointConfiguration.ToString(); + ConfigureEndpoint(this.Endpoint, this.ClientCredentials); + } + + public Service1Client(System.ServiceModel.Channels.Binding binding, System.ServiceModel.EndpointAddress remoteAddress) : + base(binding, remoteAddress) + { + } + + public System.Threading.Tasks.Task GetCollectionsAsync() + { + return base.Channel.GetCollectionsAsync(); + } + + public System.Threading.Tasks.Task GetDictionariesAsync() + { + return base.Channel.GetDictionariesAsync(); + } + + public System.Threading.Tasks.Task> GetOrderedDictionaryAsync() + { + return base.Channel.GetOrderedDictionaryAsync(); + } + + public virtual System.Threading.Tasks.Task OpenAsync() + { + return System.Threading.Tasks.Task.Factory.FromAsync(((System.ServiceModel.ICommunicationObject)(this)).BeginOpen(null, null), new System.Action(((System.ServiceModel.ICommunicationObject)(this)).EndOpen)); + } + + #if !NET6_0_OR_GREATER + public virtual System.Threading.Tasks.Task CloseAsync() + { + return System.Threading.Tasks.Task.Factory.FromAsync(((System.ServiceModel.ICommunicationObject)(this)).BeginClose(null, null), new System.Action(((System.ServiceModel.ICommunicationObject)(this)).EndClose)); + } + #endif + + private static System.ServiceModel.Channels.Binding GetBindingForEndpoint(EndpointConfiguration endpointConfiguration) + { + if ((endpointConfiguration == EndpointConfiguration.BasicHttpBinding_IService1)) + { + System.ServiceModel.BasicHttpBinding result = new System.ServiceModel.BasicHttpBinding(); + result.MaxBufferSize = int.MaxValue; + result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max; + result.MaxReceivedMessageSize = int.MaxValue; + result.AllowCookies = true; + return result; + } + throw new System.InvalidOperationException(string.Format("Could not find endpoint with name \'{0}\'.", endpointConfiguration)); + } + + private static System.ServiceModel.EndpointAddress GetEndpointAddress(EndpointConfiguration endpointConfiguration) + { + if ((endpointConfiguration == EndpointConfiguration.BasicHttpBinding_IService1)) + { + return new System.ServiceModel.EndpointAddress("http://localhost:49773/Service1.svc"); + } + throw new System.InvalidOperationException(string.Format("Could not find endpoint with name \'{0}\'.", endpointConfiguration)); + } + + private static System.ServiceModel.Channels.Binding GetDefaultBinding() + { + return Service1Client.GetBindingForEndpoint(EndpointConfiguration.BasicHttpBinding_IService1); + } + + private static System.ServiceModel.EndpointAddress GetDefaultEndpointAddress() + { + return Service1Client.GetEndpointAddress(EndpointConfiguration.BasicHttpBinding_IService1); + } + + public enum EndpointConfiguration + { + + BasicHttpBinding_IService1, + } + } +} \ No newline at end of file diff --git a/src/dotnet-svcutil/lib/tests/Baselines/CollectionTypeOptionTests/GenericSortedDict/ServiceReference/dotnet-svcutil.params.json b/src/dotnet-svcutil/lib/tests/Baselines/CollectionTypeOptionTests/GenericSortedDict/ServiceReference/dotnet-svcutil.params.json new file mode 100644 index 00000000000..e7f3ef2bf0d --- /dev/null +++ b/src/dotnet-svcutil/lib/tests/Baselines/CollectionTypeOptionTests/GenericSortedDict/ServiceReference/dotnet-svcutil.params.json @@ -0,0 +1,19 @@ +{ + "providerId": "Microsoft.Tools.ServiceModel.Svcutil", + "version": "99.99.99", + "options": { + "inputs": [ + "../../../../../../src/dotnet-svcutil/lib/tests/TestCases/wsdl/CollectionTypes.wsdl" + ], + "collectionTypes": [ + "System.Collections.Generic.LinkedList`1", + "System.Collections.Generic.SortedDictionary`2" + ], + "namespaceMappings": [ + "*, GenericSortedDict_NS" + ], + "outputFile": "Reference.cs", + "targetFramework": "N.N", + "typeReuseMode": "All" + } +} \ No newline at end of file diff --git a/src/dotnet-svcutil/lib/tests/Baselines/CollectionTypeOptionTests/GenericSortedList/GenericSortedList.csproj b/src/dotnet-svcutil/lib/tests/Baselines/CollectionTypeOptionTests/GenericSortedList/GenericSortedList.csproj new file mode 100644 index 00000000000..c2d91e178fd --- /dev/null +++ b/src/dotnet-svcutil/lib/tests/Baselines/CollectionTypeOptionTests/GenericSortedList/GenericSortedList.csproj @@ -0,0 +1,14 @@ + + + + Exe + N.N + enable + enable + + + + + + + \ No newline at end of file diff --git a/src/dotnet-svcutil/lib/tests/Baselines/CollectionTypeOptionTests/GenericSortedList/ServiceReference/Reference.cs b/src/dotnet-svcutil/lib/tests/Baselines/CollectionTypeOptionTests/GenericSortedList/ServiceReference/Reference.cs new file mode 100644 index 00000000000..9c2d70186d6 --- /dev/null +++ b/src/dotnet-svcutil/lib/tests/Baselines/CollectionTypeOptionTests/GenericSortedList/ServiceReference/Reference.cs @@ -0,0 +1,235 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace GenericSortedList_NS +{ + using System.Runtime.Serialization; + + + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "99.99.99")] + [System.Runtime.Serialization.DataContractAttribute(Name="CollectionContainer", Namespace="http://schemas.datacontract.org/2004/07/CollectionTestService")] + public partial class CollectionContainer : object + { + + private System.Collections.Generic.LinkedList NamesField; + + private System.Collections.Generic.LinkedList NumbersField; + + private System.Collections.Generic.LinkedList ValuesField; + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Collections.Generic.LinkedList Names + { + get + { + return this.NamesField; + } + set + { + this.NamesField = value; + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Collections.Generic.LinkedList Numbers + { + get + { + return this.NumbersField; + } + set + { + this.NumbersField = value; + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Collections.Generic.LinkedList Values + { + get + { + return this.ValuesField; + } + set + { + this.ValuesField = value; + } + } + } + + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "99.99.99")] + [System.Runtime.Serialization.DataContractAttribute(Name="DictionaryContainer", Namespace="http://schemas.datacontract.org/2004/07/CollectionTestService")] + public partial class DictionaryContainer : object + { + + private System.Collections.Generic.SortedList ReverseLookupField; + + private System.Collections.Generic.SortedList ScoresField; + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Collections.Generic.SortedList ReverseLookup + { + get + { + return this.ReverseLookupField; + } + set + { + this.ReverseLookupField = value; + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Collections.Generic.SortedList Scores + { + get + { + return this.ScoresField; + } + set + { + this.ScoresField = value; + } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "99.99.99")] + [System.ServiceModel.ServiceContractAttribute(ConfigurationName="GenericSortedList_NS.IService1")] + public interface IService1 + { + + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IService1/GetCollections", ReplyAction="http://tempuri.org/IService1/GetCollectionsResponse")] + System.Threading.Tasks.Task GetCollectionsAsync(); + + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IService1/GetDictionaries", ReplyAction="http://tempuri.org/IService1/GetDictionariesResponse")] + System.Threading.Tasks.Task GetDictionariesAsync(); + + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IService1/GetOrderedDictionary", ReplyAction="http://tempuri.org/IService1/GetOrderedDictionaryResponse")] + System.Threading.Tasks.Task> GetOrderedDictionaryAsync(); + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "99.99.99")] + public interface IService1Channel : GenericSortedList_NS.IService1, System.ServiceModel.IClientChannel + { + } + + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "99.99.99")] + public partial class Service1Client : System.ServiceModel.ClientBase, GenericSortedList_NS.IService1 + { + + /// + /// Implement this partial method to configure the service endpoint. + /// + /// The endpoint to configure + /// The client credentials + static partial void ConfigureEndpoint(System.ServiceModel.Description.ServiceEndpoint serviceEndpoint, System.ServiceModel.Description.ClientCredentials clientCredentials); + + public Service1Client() : + base(Service1Client.GetDefaultBinding(), Service1Client.GetDefaultEndpointAddress()) + { + this.Endpoint.Name = EndpointConfiguration.BasicHttpBinding_IService1.ToString(); + ConfigureEndpoint(this.Endpoint, this.ClientCredentials); + } + + public Service1Client(EndpointConfiguration endpointConfiguration) : + base(Service1Client.GetBindingForEndpoint(endpointConfiguration), Service1Client.GetEndpointAddress(endpointConfiguration)) + { + this.Endpoint.Name = endpointConfiguration.ToString(); + ConfigureEndpoint(this.Endpoint, this.ClientCredentials); + } + + public Service1Client(EndpointConfiguration endpointConfiguration, string remoteAddress) : + base(Service1Client.GetBindingForEndpoint(endpointConfiguration), new System.ServiceModel.EndpointAddress(remoteAddress)) + { + this.Endpoint.Name = endpointConfiguration.ToString(); + ConfigureEndpoint(this.Endpoint, this.ClientCredentials); + } + + public Service1Client(EndpointConfiguration endpointConfiguration, System.ServiceModel.EndpointAddress remoteAddress) : + base(Service1Client.GetBindingForEndpoint(endpointConfiguration), remoteAddress) + { + this.Endpoint.Name = endpointConfiguration.ToString(); + ConfigureEndpoint(this.Endpoint, this.ClientCredentials); + } + + public Service1Client(System.ServiceModel.Channels.Binding binding, System.ServiceModel.EndpointAddress remoteAddress) : + base(binding, remoteAddress) + { + } + + public System.Threading.Tasks.Task GetCollectionsAsync() + { + return base.Channel.GetCollectionsAsync(); + } + + public System.Threading.Tasks.Task GetDictionariesAsync() + { + return base.Channel.GetDictionariesAsync(); + } + + public System.Threading.Tasks.Task> GetOrderedDictionaryAsync() + { + return base.Channel.GetOrderedDictionaryAsync(); + } + + public virtual System.Threading.Tasks.Task OpenAsync() + { + return System.Threading.Tasks.Task.Factory.FromAsync(((System.ServiceModel.ICommunicationObject)(this)).BeginOpen(null, null), new System.Action(((System.ServiceModel.ICommunicationObject)(this)).EndOpen)); + } + + #if !NET6_0_OR_GREATER + public virtual System.Threading.Tasks.Task CloseAsync() + { + return System.Threading.Tasks.Task.Factory.FromAsync(((System.ServiceModel.ICommunicationObject)(this)).BeginClose(null, null), new System.Action(((System.ServiceModel.ICommunicationObject)(this)).EndClose)); + } + #endif + + private static System.ServiceModel.Channels.Binding GetBindingForEndpoint(EndpointConfiguration endpointConfiguration) + { + if ((endpointConfiguration == EndpointConfiguration.BasicHttpBinding_IService1)) + { + System.ServiceModel.BasicHttpBinding result = new System.ServiceModel.BasicHttpBinding(); + result.MaxBufferSize = int.MaxValue; + result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max; + result.MaxReceivedMessageSize = int.MaxValue; + result.AllowCookies = true; + return result; + } + throw new System.InvalidOperationException(string.Format("Could not find endpoint with name \'{0}\'.", endpointConfiguration)); + } + + private static System.ServiceModel.EndpointAddress GetEndpointAddress(EndpointConfiguration endpointConfiguration) + { + if ((endpointConfiguration == EndpointConfiguration.BasicHttpBinding_IService1)) + { + return new System.ServiceModel.EndpointAddress("http://localhost:49773/Service1.svc"); + } + throw new System.InvalidOperationException(string.Format("Could not find endpoint with name \'{0}\'.", endpointConfiguration)); + } + + private static System.ServiceModel.Channels.Binding GetDefaultBinding() + { + return Service1Client.GetBindingForEndpoint(EndpointConfiguration.BasicHttpBinding_IService1); + } + + private static System.ServiceModel.EndpointAddress GetDefaultEndpointAddress() + { + return Service1Client.GetEndpointAddress(EndpointConfiguration.BasicHttpBinding_IService1); + } + + public enum EndpointConfiguration + { + + BasicHttpBinding_IService1, + } + } +} \ No newline at end of file diff --git a/src/dotnet-svcutil/lib/tests/Baselines/CollectionTypeOptionTests/GenericSortedList/ServiceReference/dotnet-svcutil.params.json b/src/dotnet-svcutil/lib/tests/Baselines/CollectionTypeOptionTests/GenericSortedList/ServiceReference/dotnet-svcutil.params.json new file mode 100644 index 00000000000..ba688821082 --- /dev/null +++ b/src/dotnet-svcutil/lib/tests/Baselines/CollectionTypeOptionTests/GenericSortedList/ServiceReference/dotnet-svcutil.params.json @@ -0,0 +1,19 @@ +{ + "providerId": "Microsoft.Tools.ServiceModel.Svcutil", + "version": "99.99.99", + "options": { + "inputs": [ + "../../../../../../src/dotnet-svcutil/lib/tests/TestCases/wsdl/CollectionTypes.wsdl" + ], + "collectionTypes": [ + "System.Collections.Generic.LinkedList`1", + "System.Collections.Generic.SortedList`2" + ], + "namespaceMappings": [ + "*, GenericSortedList_NS" + ], + "outputFile": "Reference.cs", + "targetFramework": "N.N", + "typeReuseMode": "All" + } +} \ No newline at end of file diff --git a/src/dotnet-svcutil/lib/tests/Baselines/CollectionTypeOptionTests/HybridDictionary/HybridDictionary.csproj b/src/dotnet-svcutil/lib/tests/Baselines/CollectionTypeOptionTests/HybridDictionary/HybridDictionary.csproj new file mode 100644 index 00000000000..c2d91e178fd --- /dev/null +++ b/src/dotnet-svcutil/lib/tests/Baselines/CollectionTypeOptionTests/HybridDictionary/HybridDictionary.csproj @@ -0,0 +1,14 @@ + + + + Exe + N.N + enable + enable + + + + + + + \ No newline at end of file diff --git a/src/dotnet-svcutil/lib/tests/Baselines/CollectionTypeOptionTests/HybridDictionary/ServiceReference/Reference.cs b/src/dotnet-svcutil/lib/tests/Baselines/CollectionTypeOptionTests/HybridDictionary/ServiceReference/Reference.cs new file mode 100644 index 00000000000..92e256b359f --- /dev/null +++ b/src/dotnet-svcutil/lib/tests/Baselines/CollectionTypeOptionTests/HybridDictionary/ServiceReference/Reference.cs @@ -0,0 +1,235 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace HybridDictionary_NS +{ + using System.Runtime.Serialization; + + + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "99.99.99")] + [System.Runtime.Serialization.DataContractAttribute(Name="CollectionContainer", Namespace="http://schemas.datacontract.org/2004/07/CollectionTestService")] + public partial class CollectionContainer : object + { + + private System.Collections.Generic.List NamesField; + + private System.Collections.Generic.List NumbersField; + + private System.Collections.Generic.List ValuesField; + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Collections.Generic.List Names + { + get + { + return this.NamesField; + } + set + { + this.NamesField = value; + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Collections.Generic.List Numbers + { + get + { + return this.NumbersField; + } + set + { + this.NumbersField = value; + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Collections.Generic.List Values + { + get + { + return this.ValuesField; + } + set + { + this.ValuesField = value; + } + } + } + + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "99.99.99")] + [System.Runtime.Serialization.DataContractAttribute(Name="DictionaryContainer", Namespace="http://schemas.datacontract.org/2004/07/CollectionTestService")] + public partial class DictionaryContainer : object + { + + private System.Collections.Generic.Dictionary ReverseLookupField; + + private System.Collections.Generic.Dictionary ScoresField; + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Collections.Generic.Dictionary ReverseLookup + { + get + { + return this.ReverseLookupField; + } + set + { + this.ReverseLookupField = value; + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Collections.Generic.Dictionary Scores + { + get + { + return this.ScoresField; + } + set + { + this.ScoresField = value; + } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "99.99.99")] + [System.ServiceModel.ServiceContractAttribute(ConfigurationName="HybridDictionary_NS.IService1")] + public interface IService1 + { + + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IService1/GetCollections", ReplyAction="http://tempuri.org/IService1/GetCollectionsResponse")] + System.Threading.Tasks.Task GetCollectionsAsync(); + + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IService1/GetDictionaries", ReplyAction="http://tempuri.org/IService1/GetDictionariesResponse")] + System.Threading.Tasks.Task GetDictionariesAsync(); + + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IService1/GetOrderedDictionary", ReplyAction="http://tempuri.org/IService1/GetOrderedDictionaryResponse")] + System.Threading.Tasks.Task GetOrderedDictionaryAsync(); + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "99.99.99")] + public interface IService1Channel : HybridDictionary_NS.IService1, System.ServiceModel.IClientChannel + { + } + + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "99.99.99")] + public partial class Service1Client : System.ServiceModel.ClientBase, HybridDictionary_NS.IService1 + { + + /// + /// Implement this partial method to configure the service endpoint. + /// + /// The endpoint to configure + /// The client credentials + static partial void ConfigureEndpoint(System.ServiceModel.Description.ServiceEndpoint serviceEndpoint, System.ServiceModel.Description.ClientCredentials clientCredentials); + + public Service1Client() : + base(Service1Client.GetDefaultBinding(), Service1Client.GetDefaultEndpointAddress()) + { + this.Endpoint.Name = EndpointConfiguration.BasicHttpBinding_IService1.ToString(); + ConfigureEndpoint(this.Endpoint, this.ClientCredentials); + } + + public Service1Client(EndpointConfiguration endpointConfiguration) : + base(Service1Client.GetBindingForEndpoint(endpointConfiguration), Service1Client.GetEndpointAddress(endpointConfiguration)) + { + this.Endpoint.Name = endpointConfiguration.ToString(); + ConfigureEndpoint(this.Endpoint, this.ClientCredentials); + } + + public Service1Client(EndpointConfiguration endpointConfiguration, string remoteAddress) : + base(Service1Client.GetBindingForEndpoint(endpointConfiguration), new System.ServiceModel.EndpointAddress(remoteAddress)) + { + this.Endpoint.Name = endpointConfiguration.ToString(); + ConfigureEndpoint(this.Endpoint, this.ClientCredentials); + } + + public Service1Client(EndpointConfiguration endpointConfiguration, System.ServiceModel.EndpointAddress remoteAddress) : + base(Service1Client.GetBindingForEndpoint(endpointConfiguration), remoteAddress) + { + this.Endpoint.Name = endpointConfiguration.ToString(); + ConfigureEndpoint(this.Endpoint, this.ClientCredentials); + } + + public Service1Client(System.ServiceModel.Channels.Binding binding, System.ServiceModel.EndpointAddress remoteAddress) : + base(binding, remoteAddress) + { + } + + public System.Threading.Tasks.Task GetCollectionsAsync() + { + return base.Channel.GetCollectionsAsync(); + } + + public System.Threading.Tasks.Task GetDictionariesAsync() + { + return base.Channel.GetDictionariesAsync(); + } + + public System.Threading.Tasks.Task GetOrderedDictionaryAsync() + { + return base.Channel.GetOrderedDictionaryAsync(); + } + + public virtual System.Threading.Tasks.Task OpenAsync() + { + return System.Threading.Tasks.Task.Factory.FromAsync(((System.ServiceModel.ICommunicationObject)(this)).BeginOpen(null, null), new System.Action(((System.ServiceModel.ICommunicationObject)(this)).EndOpen)); + } + + #if !NET6_0_OR_GREATER + public virtual System.Threading.Tasks.Task CloseAsync() + { + return System.Threading.Tasks.Task.Factory.FromAsync(((System.ServiceModel.ICommunicationObject)(this)).BeginClose(null, null), new System.Action(((System.ServiceModel.ICommunicationObject)(this)).EndClose)); + } + #endif + + private static System.ServiceModel.Channels.Binding GetBindingForEndpoint(EndpointConfiguration endpointConfiguration) + { + if ((endpointConfiguration == EndpointConfiguration.BasicHttpBinding_IService1)) + { + System.ServiceModel.BasicHttpBinding result = new System.ServiceModel.BasicHttpBinding(); + result.MaxBufferSize = int.MaxValue; + result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max; + result.MaxReceivedMessageSize = int.MaxValue; + result.AllowCookies = true; + return result; + } + throw new System.InvalidOperationException(string.Format("Could not find endpoint with name \'{0}\'.", endpointConfiguration)); + } + + private static System.ServiceModel.EndpointAddress GetEndpointAddress(EndpointConfiguration endpointConfiguration) + { + if ((endpointConfiguration == EndpointConfiguration.BasicHttpBinding_IService1)) + { + return new System.ServiceModel.EndpointAddress("http://localhost:49773/Service1.svc"); + } + throw new System.InvalidOperationException(string.Format("Could not find endpoint with name \'{0}\'.", endpointConfiguration)); + } + + private static System.ServiceModel.Channels.Binding GetDefaultBinding() + { + return Service1Client.GetBindingForEndpoint(EndpointConfiguration.BasicHttpBinding_IService1); + } + + private static System.ServiceModel.EndpointAddress GetDefaultEndpointAddress() + { + return Service1Client.GetEndpointAddress(EndpointConfiguration.BasicHttpBinding_IService1); + } + + public enum EndpointConfiguration + { + + BasicHttpBinding_IService1, + } + } +} \ No newline at end of file diff --git a/src/dotnet-svcutil/lib/tests/Baselines/CollectionTypeOptionTests/HybridDictionary/ServiceReference/dotnet-svcutil.params.json b/src/dotnet-svcutil/lib/tests/Baselines/CollectionTypeOptionTests/HybridDictionary/ServiceReference/dotnet-svcutil.params.json new file mode 100644 index 00000000000..b1c67604c7f --- /dev/null +++ b/src/dotnet-svcutil/lib/tests/Baselines/CollectionTypeOptionTests/HybridDictionary/ServiceReference/dotnet-svcutil.params.json @@ -0,0 +1,19 @@ +{ + "providerId": "Microsoft.Tools.ServiceModel.Svcutil", + "version": "99.99.99", + "options": { + "inputs": [ + "../../../../../../src/dotnet-svcutil/lib/tests/TestCases/wsdl/CollectionTypes.wsdl" + ], + "collectionTypes": [ + "System.Collections.Generic.List`1", + "System.Collections.Specialized.HybridDictionary" + ], + "namespaceMappings": [ + "*, HybridDictionary_NS" + ], + "outputFile": "Reference.cs", + "targetFramework": "N.N", + "typeReuseMode": "All" + } +} \ No newline at end of file diff --git a/src/dotnet-svcutil/lib/tests/Baselines/CollectionTypeOptionTests/LegacyNonGeneric/LegacyNonGeneric.csproj b/src/dotnet-svcutil/lib/tests/Baselines/CollectionTypeOptionTests/LegacyNonGeneric/LegacyNonGeneric.csproj new file mode 100644 index 00000000000..c2d91e178fd --- /dev/null +++ b/src/dotnet-svcutil/lib/tests/Baselines/CollectionTypeOptionTests/LegacyNonGeneric/LegacyNonGeneric.csproj @@ -0,0 +1,14 @@ + + + + Exe + N.N + enable + enable + + + + + + + \ No newline at end of file diff --git a/src/dotnet-svcutil/lib/tests/Baselines/CollectionTypeOptionTests/LegacyNonGeneric/ServiceReference/Reference.cs b/src/dotnet-svcutil/lib/tests/Baselines/CollectionTypeOptionTests/LegacyNonGeneric/ServiceReference/Reference.cs new file mode 100644 index 00000000000..adcc268f5a4 --- /dev/null +++ b/src/dotnet-svcutil/lib/tests/Baselines/CollectionTypeOptionTests/LegacyNonGeneric/ServiceReference/Reference.cs @@ -0,0 +1,235 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace LegacyNonGeneric_NS +{ + using System.Runtime.Serialization; + + + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "99.99.99")] + [System.Runtime.Serialization.DataContractAttribute(Name="CollectionContainer", Namespace="http://schemas.datacontract.org/2004/07/CollectionTestService")] + public partial class CollectionContainer : object + { + + private string[] NamesField; + + private int[] NumbersField; + + private double[] ValuesField; + + [System.Runtime.Serialization.DataMemberAttribute()] + public string[] Names + { + get + { + return this.NamesField; + } + set + { + this.NamesField = value; + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public int[] Numbers + { + get + { + return this.NumbersField; + } + set + { + this.NumbersField = value; + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public double[] Values + { + get + { + return this.ValuesField; + } + set + { + this.ValuesField = value; + } + } + } + + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "99.99.99")] + [System.Runtime.Serialization.DataContractAttribute(Name="DictionaryContainer", Namespace="http://schemas.datacontract.org/2004/07/CollectionTestService")] + public partial class DictionaryContainer : object + { + + private System.Collections.Generic.Dictionary ReverseLookupField; + + private System.Collections.Generic.Dictionary ScoresField; + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Collections.Generic.Dictionary ReverseLookup + { + get + { + return this.ReverseLookupField; + } + set + { + this.ReverseLookupField = value; + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Collections.Generic.Dictionary Scores + { + get + { + return this.ScoresField; + } + set + { + this.ScoresField = value; + } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "99.99.99")] + [System.ServiceModel.ServiceContractAttribute(ConfigurationName="LegacyNonGeneric_NS.IService1")] + public interface IService1 + { + + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IService1/GetCollections", ReplyAction="http://tempuri.org/IService1/GetCollectionsResponse")] + System.Threading.Tasks.Task GetCollectionsAsync(); + + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IService1/GetDictionaries", ReplyAction="http://tempuri.org/IService1/GetDictionariesResponse")] + System.Threading.Tasks.Task GetDictionariesAsync(); + + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IService1/GetOrderedDictionary", ReplyAction="http://tempuri.org/IService1/GetOrderedDictionaryResponse")] + System.Threading.Tasks.Task GetOrderedDictionaryAsync(); + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "99.99.99")] + public interface IService1Channel : LegacyNonGeneric_NS.IService1, System.ServiceModel.IClientChannel + { + } + + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "99.99.99")] + public partial class Service1Client : System.ServiceModel.ClientBase, LegacyNonGeneric_NS.IService1 + { + + /// + /// Implement this partial method to configure the service endpoint. + /// + /// The endpoint to configure + /// The client credentials + static partial void ConfigureEndpoint(System.ServiceModel.Description.ServiceEndpoint serviceEndpoint, System.ServiceModel.Description.ClientCredentials clientCredentials); + + public Service1Client() : + base(Service1Client.GetDefaultBinding(), Service1Client.GetDefaultEndpointAddress()) + { + this.Endpoint.Name = EndpointConfiguration.BasicHttpBinding_IService1.ToString(); + ConfigureEndpoint(this.Endpoint, this.ClientCredentials); + } + + public Service1Client(EndpointConfiguration endpointConfiguration) : + base(Service1Client.GetBindingForEndpoint(endpointConfiguration), Service1Client.GetEndpointAddress(endpointConfiguration)) + { + this.Endpoint.Name = endpointConfiguration.ToString(); + ConfigureEndpoint(this.Endpoint, this.ClientCredentials); + } + + public Service1Client(EndpointConfiguration endpointConfiguration, string remoteAddress) : + base(Service1Client.GetBindingForEndpoint(endpointConfiguration), new System.ServiceModel.EndpointAddress(remoteAddress)) + { + this.Endpoint.Name = endpointConfiguration.ToString(); + ConfigureEndpoint(this.Endpoint, this.ClientCredentials); + } + + public Service1Client(EndpointConfiguration endpointConfiguration, System.ServiceModel.EndpointAddress remoteAddress) : + base(Service1Client.GetBindingForEndpoint(endpointConfiguration), remoteAddress) + { + this.Endpoint.Name = endpointConfiguration.ToString(); + ConfigureEndpoint(this.Endpoint, this.ClientCredentials); + } + + public Service1Client(System.ServiceModel.Channels.Binding binding, System.ServiceModel.EndpointAddress remoteAddress) : + base(binding, remoteAddress) + { + } + + public System.Threading.Tasks.Task GetCollectionsAsync() + { + return base.Channel.GetCollectionsAsync(); + } + + public System.Threading.Tasks.Task GetDictionariesAsync() + { + return base.Channel.GetDictionariesAsync(); + } + + public System.Threading.Tasks.Task GetOrderedDictionaryAsync() + { + return base.Channel.GetOrderedDictionaryAsync(); + } + + public virtual System.Threading.Tasks.Task OpenAsync() + { + return System.Threading.Tasks.Task.Factory.FromAsync(((System.ServiceModel.ICommunicationObject)(this)).BeginOpen(null, null), new System.Action(((System.ServiceModel.ICommunicationObject)(this)).EndOpen)); + } + + #if !NET6_0_OR_GREATER + public virtual System.Threading.Tasks.Task CloseAsync() + { + return System.Threading.Tasks.Task.Factory.FromAsync(((System.ServiceModel.ICommunicationObject)(this)).BeginClose(null, null), new System.Action(((System.ServiceModel.ICommunicationObject)(this)).EndClose)); + } + #endif + + private static System.ServiceModel.Channels.Binding GetBindingForEndpoint(EndpointConfiguration endpointConfiguration) + { + if ((endpointConfiguration == EndpointConfiguration.BasicHttpBinding_IService1)) + { + System.ServiceModel.BasicHttpBinding result = new System.ServiceModel.BasicHttpBinding(); + result.MaxBufferSize = int.MaxValue; + result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max; + result.MaxReceivedMessageSize = int.MaxValue; + result.AllowCookies = true; + return result; + } + throw new System.InvalidOperationException(string.Format("Could not find endpoint with name \'{0}\'.", endpointConfiguration)); + } + + private static System.ServiceModel.EndpointAddress GetEndpointAddress(EndpointConfiguration endpointConfiguration) + { + if ((endpointConfiguration == EndpointConfiguration.BasicHttpBinding_IService1)) + { + return new System.ServiceModel.EndpointAddress("http://localhost:49773/Service1.svc"); + } + throw new System.InvalidOperationException(string.Format("Could not find endpoint with name \'{0}\'.", endpointConfiguration)); + } + + private static System.ServiceModel.Channels.Binding GetDefaultBinding() + { + return Service1Client.GetBindingForEndpoint(EndpointConfiguration.BasicHttpBinding_IService1); + } + + private static System.ServiceModel.EndpointAddress GetDefaultEndpointAddress() + { + return Service1Client.GetEndpointAddress(EndpointConfiguration.BasicHttpBinding_IService1); + } + + public enum EndpointConfiguration + { + + BasicHttpBinding_IService1, + } + } +} \ No newline at end of file diff --git a/src/dotnet-svcutil/lib/tests/Baselines/CollectionTypeOptionTests/LegacyNonGeneric/ServiceReference/dotnet-svcutil.params.json b/src/dotnet-svcutil/lib/tests/Baselines/CollectionTypeOptionTests/LegacyNonGeneric/ServiceReference/dotnet-svcutil.params.json new file mode 100644 index 00000000000..f079ca87172 --- /dev/null +++ b/src/dotnet-svcutil/lib/tests/Baselines/CollectionTypeOptionTests/LegacyNonGeneric/ServiceReference/dotnet-svcutil.params.json @@ -0,0 +1,19 @@ +{ + "providerId": "Microsoft.Tools.ServiceModel.Svcutil", + "version": "99.99.99", + "options": { + "inputs": [ + "../../../../../../src/dotnet-svcutil/lib/tests/TestCases/wsdl/CollectionTypes.wsdl" + ], + "collectionTypes": [ + "System.Collections.ArrayList", + "System.Collections.Hashtable" + ], + "namespaceMappings": [ + "*, LegacyNonGeneric_NS" + ], + "outputFile": "Reference.cs", + "targetFramework": "N.N", + "typeReuseMode": "All" + } +} \ No newline at end of file diff --git a/src/dotnet-svcutil/lib/tests/Baselines/CollectionTypeOptionTests/ListDictionary/ListDictionary.csproj b/src/dotnet-svcutil/lib/tests/Baselines/CollectionTypeOptionTests/ListDictionary/ListDictionary.csproj new file mode 100644 index 00000000000..c2d91e178fd --- /dev/null +++ b/src/dotnet-svcutil/lib/tests/Baselines/CollectionTypeOptionTests/ListDictionary/ListDictionary.csproj @@ -0,0 +1,14 @@ + + + + Exe + N.N + enable + enable + + + + + + + \ No newline at end of file diff --git a/src/dotnet-svcutil/lib/tests/Baselines/CollectionTypeOptionTests/ListDictionary/ServiceReference/Reference.cs b/src/dotnet-svcutil/lib/tests/Baselines/CollectionTypeOptionTests/ListDictionary/ServiceReference/Reference.cs new file mode 100644 index 00000000000..57f128e6783 --- /dev/null +++ b/src/dotnet-svcutil/lib/tests/Baselines/CollectionTypeOptionTests/ListDictionary/ServiceReference/Reference.cs @@ -0,0 +1,235 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace ListDictionary_NS +{ + using System.Runtime.Serialization; + + + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "99.99.99")] + [System.Runtime.Serialization.DataContractAttribute(Name="CollectionContainer", Namespace="http://schemas.datacontract.org/2004/07/CollectionTestService")] + public partial class CollectionContainer : object + { + + private System.Collections.Generic.LinkedList NamesField; + + private System.Collections.Generic.LinkedList NumbersField; + + private System.Collections.Generic.LinkedList ValuesField; + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Collections.Generic.LinkedList Names + { + get + { + return this.NamesField; + } + set + { + this.NamesField = value; + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Collections.Generic.LinkedList Numbers + { + get + { + return this.NumbersField; + } + set + { + this.NumbersField = value; + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Collections.Generic.LinkedList Values + { + get + { + return this.ValuesField; + } + set + { + this.ValuesField = value; + } + } + } + + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "99.99.99")] + [System.Runtime.Serialization.DataContractAttribute(Name="DictionaryContainer", Namespace="http://schemas.datacontract.org/2004/07/CollectionTestService")] + public partial class DictionaryContainer : object + { + + private System.Collections.Generic.Dictionary ReverseLookupField; + + private System.Collections.Generic.Dictionary ScoresField; + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Collections.Generic.Dictionary ReverseLookup + { + get + { + return this.ReverseLookupField; + } + set + { + this.ReverseLookupField = value; + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Collections.Generic.Dictionary Scores + { + get + { + return this.ScoresField; + } + set + { + this.ScoresField = value; + } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "99.99.99")] + [System.ServiceModel.ServiceContractAttribute(ConfigurationName="ListDictionary_NS.IService1")] + public interface IService1 + { + + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IService1/GetCollections", ReplyAction="http://tempuri.org/IService1/GetCollectionsResponse")] + System.Threading.Tasks.Task GetCollectionsAsync(); + + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IService1/GetDictionaries", ReplyAction="http://tempuri.org/IService1/GetDictionariesResponse")] + System.Threading.Tasks.Task GetDictionariesAsync(); + + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IService1/GetOrderedDictionary", ReplyAction="http://tempuri.org/IService1/GetOrderedDictionaryResponse")] + System.Threading.Tasks.Task GetOrderedDictionaryAsync(); + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "99.99.99")] + public interface IService1Channel : ListDictionary_NS.IService1, System.ServiceModel.IClientChannel + { + } + + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "99.99.99")] + public partial class Service1Client : System.ServiceModel.ClientBase, ListDictionary_NS.IService1 + { + + /// + /// Implement this partial method to configure the service endpoint. + /// + /// The endpoint to configure + /// The client credentials + static partial void ConfigureEndpoint(System.ServiceModel.Description.ServiceEndpoint serviceEndpoint, System.ServiceModel.Description.ClientCredentials clientCredentials); + + public Service1Client() : + base(Service1Client.GetDefaultBinding(), Service1Client.GetDefaultEndpointAddress()) + { + this.Endpoint.Name = EndpointConfiguration.BasicHttpBinding_IService1.ToString(); + ConfigureEndpoint(this.Endpoint, this.ClientCredentials); + } + + public Service1Client(EndpointConfiguration endpointConfiguration) : + base(Service1Client.GetBindingForEndpoint(endpointConfiguration), Service1Client.GetEndpointAddress(endpointConfiguration)) + { + this.Endpoint.Name = endpointConfiguration.ToString(); + ConfigureEndpoint(this.Endpoint, this.ClientCredentials); + } + + public Service1Client(EndpointConfiguration endpointConfiguration, string remoteAddress) : + base(Service1Client.GetBindingForEndpoint(endpointConfiguration), new System.ServiceModel.EndpointAddress(remoteAddress)) + { + this.Endpoint.Name = endpointConfiguration.ToString(); + ConfigureEndpoint(this.Endpoint, this.ClientCredentials); + } + + public Service1Client(EndpointConfiguration endpointConfiguration, System.ServiceModel.EndpointAddress remoteAddress) : + base(Service1Client.GetBindingForEndpoint(endpointConfiguration), remoteAddress) + { + this.Endpoint.Name = endpointConfiguration.ToString(); + ConfigureEndpoint(this.Endpoint, this.ClientCredentials); + } + + public Service1Client(System.ServiceModel.Channels.Binding binding, System.ServiceModel.EndpointAddress remoteAddress) : + base(binding, remoteAddress) + { + } + + public System.Threading.Tasks.Task GetCollectionsAsync() + { + return base.Channel.GetCollectionsAsync(); + } + + public System.Threading.Tasks.Task GetDictionariesAsync() + { + return base.Channel.GetDictionariesAsync(); + } + + public System.Threading.Tasks.Task GetOrderedDictionaryAsync() + { + return base.Channel.GetOrderedDictionaryAsync(); + } + + public virtual System.Threading.Tasks.Task OpenAsync() + { + return System.Threading.Tasks.Task.Factory.FromAsync(((System.ServiceModel.ICommunicationObject)(this)).BeginOpen(null, null), new System.Action(((System.ServiceModel.ICommunicationObject)(this)).EndOpen)); + } + + #if !NET6_0_OR_GREATER + public virtual System.Threading.Tasks.Task CloseAsync() + { + return System.Threading.Tasks.Task.Factory.FromAsync(((System.ServiceModel.ICommunicationObject)(this)).BeginClose(null, null), new System.Action(((System.ServiceModel.ICommunicationObject)(this)).EndClose)); + } + #endif + + private static System.ServiceModel.Channels.Binding GetBindingForEndpoint(EndpointConfiguration endpointConfiguration) + { + if ((endpointConfiguration == EndpointConfiguration.BasicHttpBinding_IService1)) + { + System.ServiceModel.BasicHttpBinding result = new System.ServiceModel.BasicHttpBinding(); + result.MaxBufferSize = int.MaxValue; + result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max; + result.MaxReceivedMessageSize = int.MaxValue; + result.AllowCookies = true; + return result; + } + throw new System.InvalidOperationException(string.Format("Could not find endpoint with name \'{0}\'.", endpointConfiguration)); + } + + private static System.ServiceModel.EndpointAddress GetEndpointAddress(EndpointConfiguration endpointConfiguration) + { + if ((endpointConfiguration == EndpointConfiguration.BasicHttpBinding_IService1)) + { + return new System.ServiceModel.EndpointAddress("http://localhost:49773/Service1.svc"); + } + throw new System.InvalidOperationException(string.Format("Could not find endpoint with name \'{0}\'.", endpointConfiguration)); + } + + private static System.ServiceModel.Channels.Binding GetDefaultBinding() + { + return Service1Client.GetBindingForEndpoint(EndpointConfiguration.BasicHttpBinding_IService1); + } + + private static System.ServiceModel.EndpointAddress GetDefaultEndpointAddress() + { + return Service1Client.GetEndpointAddress(EndpointConfiguration.BasicHttpBinding_IService1); + } + + public enum EndpointConfiguration + { + + BasicHttpBinding_IService1, + } + } +} \ No newline at end of file diff --git a/src/dotnet-svcutil/lib/tests/Baselines/CollectionTypeOptionTests/ListDictionary/ServiceReference/dotnet-svcutil.params.json b/src/dotnet-svcutil/lib/tests/Baselines/CollectionTypeOptionTests/ListDictionary/ServiceReference/dotnet-svcutil.params.json new file mode 100644 index 00000000000..af2b80e8b79 --- /dev/null +++ b/src/dotnet-svcutil/lib/tests/Baselines/CollectionTypeOptionTests/ListDictionary/ServiceReference/dotnet-svcutil.params.json @@ -0,0 +1,19 @@ +{ + "providerId": "Microsoft.Tools.ServiceModel.Svcutil", + "version": "99.99.99", + "options": { + "inputs": [ + "../../../../../../src/dotnet-svcutil/lib/tests/TestCases/wsdl/CollectionTypes.wsdl" + ], + "collectionTypes": [ + "System.Collections.Generic.LinkedList`1", + "System.Collections.Specialized.ListDictionary" + ], + "namespaceMappings": [ + "*, ListDictionary_NS" + ], + "outputFile": "Reference.cs", + "targetFramework": "N.N", + "typeReuseMode": "All" + } +} \ No newline at end of file diff --git a/src/dotnet-svcutil/lib/tests/Baselines/CollectionTypeOptionTests/NonGenericSortedDict/NonGenericSortedDict.csproj b/src/dotnet-svcutil/lib/tests/Baselines/CollectionTypeOptionTests/NonGenericSortedDict/NonGenericSortedDict.csproj new file mode 100644 index 00000000000..c2d91e178fd --- /dev/null +++ b/src/dotnet-svcutil/lib/tests/Baselines/CollectionTypeOptionTests/NonGenericSortedDict/NonGenericSortedDict.csproj @@ -0,0 +1,14 @@ + + + + Exe + N.N + enable + enable + + + + + + + \ No newline at end of file diff --git a/src/dotnet-svcutil/lib/tests/Baselines/CollectionTypeOptionTests/NonGenericSortedDict/ServiceReference/Reference.cs b/src/dotnet-svcutil/lib/tests/Baselines/CollectionTypeOptionTests/NonGenericSortedDict/ServiceReference/Reference.cs new file mode 100644 index 00000000000..ab28bbfbf74 --- /dev/null +++ b/src/dotnet-svcutil/lib/tests/Baselines/CollectionTypeOptionTests/NonGenericSortedDict/ServiceReference/Reference.cs @@ -0,0 +1,235 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace NonGenericSortedDict_NS +{ + using System.Runtime.Serialization; + + + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "99.99.99")] + [System.Runtime.Serialization.DataContractAttribute(Name="CollectionContainer", Namespace="http://schemas.datacontract.org/2004/07/CollectionTestService")] + public partial class CollectionContainer : object + { + + private System.Collections.ObjectModel.Collection NamesField; + + private System.Collections.ObjectModel.Collection NumbersField; + + private System.Collections.ObjectModel.Collection ValuesField; + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Collections.ObjectModel.Collection Names + { + get + { + return this.NamesField; + } + set + { + this.NamesField = value; + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Collections.ObjectModel.Collection Numbers + { + get + { + return this.NumbersField; + } + set + { + this.NumbersField = value; + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Collections.ObjectModel.Collection Values + { + get + { + return this.ValuesField; + } + set + { + this.ValuesField = value; + } + } + } + + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "99.99.99")] + [System.Runtime.Serialization.DataContractAttribute(Name="DictionaryContainer", Namespace="http://schemas.datacontract.org/2004/07/CollectionTestService")] + public partial class DictionaryContainer : object + { + + private System.Collections.Generic.Dictionary ReverseLookupField; + + private System.Collections.Generic.Dictionary ScoresField; + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Collections.Generic.Dictionary ReverseLookup + { + get + { + return this.ReverseLookupField; + } + set + { + this.ReverseLookupField = value; + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Collections.Generic.Dictionary Scores + { + get + { + return this.ScoresField; + } + set + { + this.ScoresField = value; + } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "99.99.99")] + [System.ServiceModel.ServiceContractAttribute(ConfigurationName="NonGenericSortedDict_NS.IService1")] + public interface IService1 + { + + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IService1/GetCollections", ReplyAction="http://tempuri.org/IService1/GetCollectionsResponse")] + System.Threading.Tasks.Task GetCollectionsAsync(); + + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IService1/GetDictionaries", ReplyAction="http://tempuri.org/IService1/GetDictionariesResponse")] + System.Threading.Tasks.Task GetDictionariesAsync(); + + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IService1/GetOrderedDictionary", ReplyAction="http://tempuri.org/IService1/GetOrderedDictionaryResponse")] + System.Threading.Tasks.Task GetOrderedDictionaryAsync(); + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "99.99.99")] + public interface IService1Channel : NonGenericSortedDict_NS.IService1, System.ServiceModel.IClientChannel + { + } + + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "99.99.99")] + public partial class Service1Client : System.ServiceModel.ClientBase, NonGenericSortedDict_NS.IService1 + { + + /// + /// Implement this partial method to configure the service endpoint. + /// + /// The endpoint to configure + /// The client credentials + static partial void ConfigureEndpoint(System.ServiceModel.Description.ServiceEndpoint serviceEndpoint, System.ServiceModel.Description.ClientCredentials clientCredentials); + + public Service1Client() : + base(Service1Client.GetDefaultBinding(), Service1Client.GetDefaultEndpointAddress()) + { + this.Endpoint.Name = EndpointConfiguration.BasicHttpBinding_IService1.ToString(); + ConfigureEndpoint(this.Endpoint, this.ClientCredentials); + } + + public Service1Client(EndpointConfiguration endpointConfiguration) : + base(Service1Client.GetBindingForEndpoint(endpointConfiguration), Service1Client.GetEndpointAddress(endpointConfiguration)) + { + this.Endpoint.Name = endpointConfiguration.ToString(); + ConfigureEndpoint(this.Endpoint, this.ClientCredentials); + } + + public Service1Client(EndpointConfiguration endpointConfiguration, string remoteAddress) : + base(Service1Client.GetBindingForEndpoint(endpointConfiguration), new System.ServiceModel.EndpointAddress(remoteAddress)) + { + this.Endpoint.Name = endpointConfiguration.ToString(); + ConfigureEndpoint(this.Endpoint, this.ClientCredentials); + } + + public Service1Client(EndpointConfiguration endpointConfiguration, System.ServiceModel.EndpointAddress remoteAddress) : + base(Service1Client.GetBindingForEndpoint(endpointConfiguration), remoteAddress) + { + this.Endpoint.Name = endpointConfiguration.ToString(); + ConfigureEndpoint(this.Endpoint, this.ClientCredentials); + } + + public Service1Client(System.ServiceModel.Channels.Binding binding, System.ServiceModel.EndpointAddress remoteAddress) : + base(binding, remoteAddress) + { + } + + public System.Threading.Tasks.Task GetCollectionsAsync() + { + return base.Channel.GetCollectionsAsync(); + } + + public System.Threading.Tasks.Task GetDictionariesAsync() + { + return base.Channel.GetDictionariesAsync(); + } + + public System.Threading.Tasks.Task GetOrderedDictionaryAsync() + { + return base.Channel.GetOrderedDictionaryAsync(); + } + + public virtual System.Threading.Tasks.Task OpenAsync() + { + return System.Threading.Tasks.Task.Factory.FromAsync(((System.ServiceModel.ICommunicationObject)(this)).BeginOpen(null, null), new System.Action(((System.ServiceModel.ICommunicationObject)(this)).EndOpen)); + } + + #if !NET6_0_OR_GREATER + public virtual System.Threading.Tasks.Task CloseAsync() + { + return System.Threading.Tasks.Task.Factory.FromAsync(((System.ServiceModel.ICommunicationObject)(this)).BeginClose(null, null), new System.Action(((System.ServiceModel.ICommunicationObject)(this)).EndClose)); + } + #endif + + private static System.ServiceModel.Channels.Binding GetBindingForEndpoint(EndpointConfiguration endpointConfiguration) + { + if ((endpointConfiguration == EndpointConfiguration.BasicHttpBinding_IService1)) + { + System.ServiceModel.BasicHttpBinding result = new System.ServiceModel.BasicHttpBinding(); + result.MaxBufferSize = int.MaxValue; + result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max; + result.MaxReceivedMessageSize = int.MaxValue; + result.AllowCookies = true; + return result; + } + throw new System.InvalidOperationException(string.Format("Could not find endpoint with name \'{0}\'.", endpointConfiguration)); + } + + private static System.ServiceModel.EndpointAddress GetEndpointAddress(EndpointConfiguration endpointConfiguration) + { + if ((endpointConfiguration == EndpointConfiguration.BasicHttpBinding_IService1)) + { + return new System.ServiceModel.EndpointAddress("http://localhost:49773/Service1.svc"); + } + throw new System.InvalidOperationException(string.Format("Could not find endpoint with name \'{0}\'.", endpointConfiguration)); + } + + private static System.ServiceModel.Channels.Binding GetDefaultBinding() + { + return Service1Client.GetBindingForEndpoint(EndpointConfiguration.BasicHttpBinding_IService1); + } + + private static System.ServiceModel.EndpointAddress GetDefaultEndpointAddress() + { + return Service1Client.GetEndpointAddress(EndpointConfiguration.BasicHttpBinding_IService1); + } + + public enum EndpointConfiguration + { + + BasicHttpBinding_IService1, + } + } +} \ No newline at end of file diff --git a/src/dotnet-svcutil/lib/tests/Baselines/CollectionTypeOptionTests/NonGenericSortedDict/ServiceReference/dotnet-svcutil.params.json b/src/dotnet-svcutil/lib/tests/Baselines/CollectionTypeOptionTests/NonGenericSortedDict/ServiceReference/dotnet-svcutil.params.json new file mode 100644 index 00000000000..a68113ac00f --- /dev/null +++ b/src/dotnet-svcutil/lib/tests/Baselines/CollectionTypeOptionTests/NonGenericSortedDict/ServiceReference/dotnet-svcutil.params.json @@ -0,0 +1,19 @@ +{ + "providerId": "Microsoft.Tools.ServiceModel.Svcutil", + "version": "99.99.99", + "options": { + "inputs": [ + "../../../../../../src/dotnet-svcutil/lib/tests/TestCases/wsdl/CollectionTypes.wsdl" + ], + "collectionTypes": [ + "System.Collections.ObjectModel.Collection`1", + "System.Collections.SortedList" + ], + "namespaceMappings": [ + "*, NonGenericSortedDict_NS" + ], + "outputFile": "Reference.cs", + "targetFramework": "N.N", + "typeReuseMode": "All" + } +} \ No newline at end of file diff --git a/src/dotnet-svcutil/lib/tests/Baselines/CollectionTypeOptionTests/ObjectModelOrderedDict/ObjectModelOrderedDict.csproj b/src/dotnet-svcutil/lib/tests/Baselines/CollectionTypeOptionTests/ObjectModelOrderedDict/ObjectModelOrderedDict.csproj new file mode 100644 index 00000000000..c2d91e178fd --- /dev/null +++ b/src/dotnet-svcutil/lib/tests/Baselines/CollectionTypeOptionTests/ObjectModelOrderedDict/ObjectModelOrderedDict.csproj @@ -0,0 +1,14 @@ + + + + Exe + N.N + enable + enable + + + + + + + \ No newline at end of file diff --git a/src/dotnet-svcutil/lib/tests/Baselines/CollectionTypeOptionTests/ObjectModelOrderedDict/ServiceReference/Reference.cs b/src/dotnet-svcutil/lib/tests/Baselines/CollectionTypeOptionTests/ObjectModelOrderedDict/ServiceReference/Reference.cs new file mode 100644 index 00000000000..254d1ea1cd5 --- /dev/null +++ b/src/dotnet-svcutil/lib/tests/Baselines/CollectionTypeOptionTests/ObjectModelOrderedDict/ServiceReference/Reference.cs @@ -0,0 +1,235 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace ObjectModelOrderedDict_NS +{ + using System.Runtime.Serialization; + + + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "99.99.99")] + [System.Runtime.Serialization.DataContractAttribute(Name="CollectionContainer", Namespace="http://schemas.datacontract.org/2004/07/CollectionTestService")] + public partial class CollectionContainer : object + { + + private System.Collections.ObjectModel.ObservableCollection NamesField; + + private System.Collections.ObjectModel.ObservableCollection NumbersField; + + private System.Collections.ObjectModel.ObservableCollection ValuesField; + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Collections.ObjectModel.ObservableCollection Names + { + get + { + return this.NamesField; + } + set + { + this.NamesField = value; + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Collections.ObjectModel.ObservableCollection Numbers + { + get + { + return this.NumbersField; + } + set + { + this.NumbersField = value; + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Collections.ObjectModel.ObservableCollection Values + { + get + { + return this.ValuesField; + } + set + { + this.ValuesField = value; + } + } + } + + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "99.99.99")] + [System.Runtime.Serialization.DataContractAttribute(Name="DictionaryContainer", Namespace="http://schemas.datacontract.org/2004/07/CollectionTestService")] + public partial class DictionaryContainer : object + { + + private System.Collections.Generic.Dictionary ReverseLookupField; + + private System.Collections.Generic.Dictionary ScoresField; + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Collections.Generic.Dictionary ReverseLookup + { + get + { + return this.ReverseLookupField; + } + set + { + this.ReverseLookupField = value; + } + } + + [System.Runtime.Serialization.DataMemberAttribute()] + public System.Collections.Generic.Dictionary Scores + { + get + { + return this.ScoresField; + } + set + { + this.ScoresField = value; + } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "99.99.99")] + [System.ServiceModel.ServiceContractAttribute(ConfigurationName="ObjectModelOrderedDict_NS.IService1")] + public interface IService1 + { + + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IService1/GetCollections", ReplyAction="http://tempuri.org/IService1/GetCollectionsResponse")] + System.Threading.Tasks.Task GetCollectionsAsync(); + + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IService1/GetDictionaries", ReplyAction="http://tempuri.org/IService1/GetDictionariesResponse")] + System.Threading.Tasks.Task GetDictionariesAsync(); + + [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IService1/GetOrderedDictionary", ReplyAction="http://tempuri.org/IService1/GetOrderedDictionaryResponse")] + System.Threading.Tasks.Task GetOrderedDictionaryAsync(); + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "99.99.99")] + public interface IService1Channel : ObjectModelOrderedDict_NS.IService1, System.ServiceModel.IClientChannel + { + } + + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "99.99.99")] + public partial class Service1Client : System.ServiceModel.ClientBase, ObjectModelOrderedDict_NS.IService1 + { + + /// + /// Implement this partial method to configure the service endpoint. + /// + /// The endpoint to configure + /// The client credentials + static partial void ConfigureEndpoint(System.ServiceModel.Description.ServiceEndpoint serviceEndpoint, System.ServiceModel.Description.ClientCredentials clientCredentials); + + public Service1Client() : + base(Service1Client.GetDefaultBinding(), Service1Client.GetDefaultEndpointAddress()) + { + this.Endpoint.Name = EndpointConfiguration.BasicHttpBinding_IService1.ToString(); + ConfigureEndpoint(this.Endpoint, this.ClientCredentials); + } + + public Service1Client(EndpointConfiguration endpointConfiguration) : + base(Service1Client.GetBindingForEndpoint(endpointConfiguration), Service1Client.GetEndpointAddress(endpointConfiguration)) + { + this.Endpoint.Name = endpointConfiguration.ToString(); + ConfigureEndpoint(this.Endpoint, this.ClientCredentials); + } + + public Service1Client(EndpointConfiguration endpointConfiguration, string remoteAddress) : + base(Service1Client.GetBindingForEndpoint(endpointConfiguration), new System.ServiceModel.EndpointAddress(remoteAddress)) + { + this.Endpoint.Name = endpointConfiguration.ToString(); + ConfigureEndpoint(this.Endpoint, this.ClientCredentials); + } + + public Service1Client(EndpointConfiguration endpointConfiguration, System.ServiceModel.EndpointAddress remoteAddress) : + base(Service1Client.GetBindingForEndpoint(endpointConfiguration), remoteAddress) + { + this.Endpoint.Name = endpointConfiguration.ToString(); + ConfigureEndpoint(this.Endpoint, this.ClientCredentials); + } + + public Service1Client(System.ServiceModel.Channels.Binding binding, System.ServiceModel.EndpointAddress remoteAddress) : + base(binding, remoteAddress) + { + } + + public System.Threading.Tasks.Task GetCollectionsAsync() + { + return base.Channel.GetCollectionsAsync(); + } + + public System.Threading.Tasks.Task GetDictionariesAsync() + { + return base.Channel.GetDictionariesAsync(); + } + + public System.Threading.Tasks.Task GetOrderedDictionaryAsync() + { + return base.Channel.GetOrderedDictionaryAsync(); + } + + public virtual System.Threading.Tasks.Task OpenAsync() + { + return System.Threading.Tasks.Task.Factory.FromAsync(((System.ServiceModel.ICommunicationObject)(this)).BeginOpen(null, null), new System.Action(((System.ServiceModel.ICommunicationObject)(this)).EndOpen)); + } + + #if !NET6_0_OR_GREATER + public virtual System.Threading.Tasks.Task CloseAsync() + { + return System.Threading.Tasks.Task.Factory.FromAsync(((System.ServiceModel.ICommunicationObject)(this)).BeginClose(null, null), new System.Action(((System.ServiceModel.ICommunicationObject)(this)).EndClose)); + } + #endif + + private static System.ServiceModel.Channels.Binding GetBindingForEndpoint(EndpointConfiguration endpointConfiguration) + { + if ((endpointConfiguration == EndpointConfiguration.BasicHttpBinding_IService1)) + { + System.ServiceModel.BasicHttpBinding result = new System.ServiceModel.BasicHttpBinding(); + result.MaxBufferSize = int.MaxValue; + result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max; + result.MaxReceivedMessageSize = int.MaxValue; + result.AllowCookies = true; + return result; + } + throw new System.InvalidOperationException(string.Format("Could not find endpoint with name \'{0}\'.", endpointConfiguration)); + } + + private static System.ServiceModel.EndpointAddress GetEndpointAddress(EndpointConfiguration endpointConfiguration) + { + if ((endpointConfiguration == EndpointConfiguration.BasicHttpBinding_IService1)) + { + return new System.ServiceModel.EndpointAddress("http://localhost:49773/Service1.svc"); + } + throw new System.InvalidOperationException(string.Format("Could not find endpoint with name \'{0}\'.", endpointConfiguration)); + } + + private static System.ServiceModel.Channels.Binding GetDefaultBinding() + { + return Service1Client.GetBindingForEndpoint(EndpointConfiguration.BasicHttpBinding_IService1); + } + + private static System.ServiceModel.EndpointAddress GetDefaultEndpointAddress() + { + return Service1Client.GetEndpointAddress(EndpointConfiguration.BasicHttpBinding_IService1); + } + + public enum EndpointConfiguration + { + + BasicHttpBinding_IService1, + } + } +} \ No newline at end of file diff --git a/src/dotnet-svcutil/lib/tests/Baselines/CollectionTypeOptionTests/ObjectModelOrderedDict/ServiceReference/dotnet-svcutil.params.json b/src/dotnet-svcutil/lib/tests/Baselines/CollectionTypeOptionTests/ObjectModelOrderedDict/ServiceReference/dotnet-svcutil.params.json new file mode 100644 index 00000000000..b42ea793300 --- /dev/null +++ b/src/dotnet-svcutil/lib/tests/Baselines/CollectionTypeOptionTests/ObjectModelOrderedDict/ServiceReference/dotnet-svcutil.params.json @@ -0,0 +1,19 @@ +{ + "providerId": "Microsoft.Tools.ServiceModel.Svcutil", + "version": "99.99.99", + "options": { + "inputs": [ + "../../../../../../src/dotnet-svcutil/lib/tests/TestCases/wsdl/CollectionTypes.wsdl" + ], + "collectionTypes": [ + "System.Collections.ObjectModel.ObservableCollection`1", + "System.Collections.Specialized.OrderedDictionary" + ], + "namespaceMappings": [ + "*, ObjectModelOrderedDict_NS" + ], + "outputFile": "Reference.cs", + "targetFramework": "N.N", + "typeReuseMode": "All" + } +} \ No newline at end of file diff --git a/src/dotnet-svcutil/lib/tests/Baselines/TFMBootstrap/tfmDefault/SvcutilBootstrapper/SvcutilBootstrapper.csproj b/src/dotnet-svcutil/lib/tests/Baselines/TFMBootstrap/tfmDefault/SvcutilBootstrapper/SvcutilBootstrapper.csproj index da51ef7058d..3f012780f2d 100644 --- a/src/dotnet-svcutil/lib/tests/Baselines/TFMBootstrap/tfmDefault/SvcutilBootstrapper/SvcutilBootstrapper.csproj +++ b/src/dotnet-svcutil/lib/tests/Baselines/TFMBootstrap/tfmDefault/SvcutilBootstrapper/SvcutilBootstrapper.csproj @@ -6,14 +6,14 @@ enable enable + $(NoWarn);MSB3277 $resultPath$/TestResults/TFMBootstrap/tfmDefault/bin/Debug/DOTNET_VERSION/dotnet-svcutil-lib.dll - - - + + diff --git a/src/dotnet-svcutil/lib/tests/Baselines/TFMBootstrap/tfmNet60/SvcutilBootstrapper/SvcutilBootstrapper.csproj b/src/dotnet-svcutil/lib/tests/Baselines/TFMBootstrap/tfmNet60/SvcutilBootstrapper/SvcutilBootstrapper.csproj index 1e16b6332fc..2f79e9f9356 100644 --- a/src/dotnet-svcutil/lib/tests/Baselines/TFMBootstrap/tfmNet60/SvcutilBootstrapper/SvcutilBootstrapper.csproj +++ b/src/dotnet-svcutil/lib/tests/Baselines/TFMBootstrap/tfmNet60/SvcutilBootstrapper/SvcutilBootstrapper.csproj @@ -6,14 +6,14 @@ enable enable + $(NoWarn);MSB3277 $resultPath$/TestResults/TFMBootstrap/tfmNet60/bin/Debug/DOTNET_VERSION/dotnet-svcutil-lib.dll - - - + + diff --git a/src/dotnet-svcutil/lib/tests/Baselines/TFMBootstrap/tfmNetstd20/SvcutilBootstrapper/SvcutilBootstrapper.csproj b/src/dotnet-svcutil/lib/tests/Baselines/TFMBootstrap/tfmNetstd20/SvcutilBootstrapper/SvcutilBootstrapper.csproj index 7b4644e1b58..b60fb8020a7 100644 --- a/src/dotnet-svcutil/lib/tests/Baselines/TFMBootstrap/tfmNetstd20/SvcutilBootstrapper/SvcutilBootstrapper.csproj +++ b/src/dotnet-svcutil/lib/tests/Baselines/TFMBootstrap/tfmNetstd20/SvcutilBootstrapper/SvcutilBootstrapper.csproj @@ -6,14 +6,14 @@ enable enable + $(NoWarn);MSB3277 $resultPath$/TestResults/TFMBootstrap/tfmNetstd20/bin/Debug/DOTNET_VERSION/dotnet-svcutil-lib.dll - - - + + diff --git a/src/dotnet-svcutil/lib/tests/Baselines/TFMBootstrap/tfmNetstd21/SvcutilBootstrapper/SvcutilBootstrapper.csproj b/src/dotnet-svcutil/lib/tests/Baselines/TFMBootstrap/tfmNetstd21/SvcutilBootstrapper/SvcutilBootstrapper.csproj index 7f6d3b330bf..8073f030d27 100644 --- a/src/dotnet-svcutil/lib/tests/Baselines/TFMBootstrap/tfmNetstd21/SvcutilBootstrapper/SvcutilBootstrapper.csproj +++ b/src/dotnet-svcutil/lib/tests/Baselines/TFMBootstrap/tfmNetstd21/SvcutilBootstrapper/SvcutilBootstrapper.csproj @@ -6,14 +6,14 @@ enable enable + $(NoWarn);MSB3277 $resultPath$/TestResults/TFMBootstrap/tfmNetstd21/bin/Debug/DOTNET_VERSION/dotnet-svcutil-lib.dll - - - + + diff --git a/src/dotnet-svcutil/lib/tests/Baselines/TFMBootstrapGlobal/tfmGlobalDefault/SvcutilBootstrapper/SvcutilBootstrapper.csproj b/src/dotnet-svcutil/lib/tests/Baselines/TFMBootstrapGlobal/tfmGlobalDefault/SvcutilBootstrapper/SvcutilBootstrapper.csproj index a806af8fba7..4c8eb386761 100644 --- a/src/dotnet-svcutil/lib/tests/Baselines/TFMBootstrapGlobal/tfmGlobalDefault/SvcutilBootstrapper/SvcutilBootstrapper.csproj +++ b/src/dotnet-svcutil/lib/tests/Baselines/TFMBootstrapGlobal/tfmGlobalDefault/SvcutilBootstrapper/SvcutilBootstrapper.csproj @@ -6,14 +6,14 @@ enable enable + $(NoWarn);MSB3277 $USERPROFILE$/.dotnet/tools/.store/dotnet-svcutil/99.99.99/dotnet-svcutil/99.99.99/tools/DOTNET_VERSION/any/dotnet-svcutil-lib.dll - - - + + diff --git a/src/dotnet-svcutil/lib/tests/Baselines/TFMBootstrapGlobal/tfmGlobalNetstd20/SvcutilBootstrapper/SvcutilBootstrapper.csproj b/src/dotnet-svcutil/lib/tests/Baselines/TFMBootstrapGlobal/tfmGlobalNetstd20/SvcutilBootstrapper/SvcutilBootstrapper.csproj index a806af8fba7..4c8eb386761 100644 --- a/src/dotnet-svcutil/lib/tests/Baselines/TFMBootstrapGlobal/tfmGlobalNetstd20/SvcutilBootstrapper/SvcutilBootstrapper.csproj +++ b/src/dotnet-svcutil/lib/tests/Baselines/TFMBootstrapGlobal/tfmGlobalNetstd20/SvcutilBootstrapper/SvcutilBootstrapper.csproj @@ -6,14 +6,14 @@ enable enable + $(NoWarn);MSB3277 $USERPROFILE$/.dotnet/tools/.store/dotnet-svcutil/99.99.99/dotnet-svcutil/99.99.99/tools/DOTNET_VERSION/any/dotnet-svcutil-lib.dll - - - + + diff --git a/src/dotnet-svcutil/lib/tests/TestCases/wsdl/CollectionTypes.wsdl b/src/dotnet-svcutil/lib/tests/TestCases/wsdl/CollectionTypes.wsdl new file mode 100644 index 00000000000..8cb83d65281 --- /dev/null +++ b/src/dotnet-svcutil/lib/tests/TestCases/wsdl/CollectionTypes.wsdl @@ -0,0 +1,244 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +true + + + + + + + + + + + + + + + + + +true + + + + + + + + + + + + + + + + + +true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/dotnet-svcutil/lib/tests/src/GlobalToolTests.cs b/src/dotnet-svcutil/lib/tests/src/GlobalToolTests.cs index be683bb7a8a..4d3bb27c2a7 100644 --- a/src/dotnet-svcutil/lib/tests/src/GlobalToolTests.cs +++ b/src/dotnet-svcutil/lib/tests/src/GlobalToolTests.cs @@ -220,5 +220,27 @@ public void ReuseIXmlSerializableType() var options = $"{uri} -r {refs} -nl -v minimal -n \"\"*,{this_TestCaseName}_NS\"\""; TestGlobalSvcutil(options); } + + [Trait("Category", "BVT")] + [Theory] + [InlineData("LegacyNonGeneric", "System.Collections.ArrayList", "System.Collections.Hashtable")] + [InlineData("GenericBaseline", "System.Collections.Generic.List`1", "System.Collections.Generic.Dictionary`2")] + [InlineData("GenericSortedDict", "System.Collections.Generic.LinkedList`1", "System.Collections.Generic.SortedDictionary`2")] + [InlineData("GenericSortedList", "System.Collections.Generic.LinkedList`1", "System.Collections.Generic.SortedList`2")] + [InlineData("ObjectModelOrderedDict", "System.Collections.ObjectModel.ObservableCollection`1", "System.Collections.Specialized.OrderedDictionary")] + [InlineData("NonGenericSortedDict", "System.Collections.ObjectModel.Collection`1", "System.Collections.SortedList")] + [InlineData("HybridDictionary", "System.Collections.Generic.List`1", "System.Collections.Specialized.HybridDictionary")] + [InlineData("ListDictionary", "System.Collections.Generic.LinkedList`1", "System.Collections.Specialized.ListDictionary")] + public void CollectionTypeOptionTests(string testCaseName, string collectionType, string dictionaryType) + { + this_TestCaseName = "CollectionTypeOptionTests"; + TestFixture(); + + InitializeGlobal(testCaseName); + + var uri = Path.Combine(g_TestCasesDir, "wsdl", "CollectionTypes.wsdl"); + var options = $"{uri} --collectionType {collectionType} --collectionType {dictionaryType} -nl -v minimal -n \"\"*,{testCaseName}_NS\"\""; + TestGlobalSvcutil(options); + } } }