diff --git a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/AzureBodyDurationAllSync/AutoRestDurationTestService.cs b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/AzureBodyDurationAllSync/AutoRestDurationTestService.cs
index 72bd4cd57bc98..343555c4d5142 100644
--- a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/AzureBodyDurationAllSync/AutoRestDurationTestService.cs
+++ b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/AzureBodyDurationAllSync/AutoRestDurationTestService.cs
@@ -106,6 +106,9 @@ protected AutoRestDurationTestService(HttpClientHandler rootHandler, params Dele
///
/// Optional. The delegating handlers to add to the http client pipeline.
///
+ ///
+ /// Thrown when a required parameter is null
+ ///
protected AutoRestDurationTestService(Uri baseUri, params DelegatingHandler[] handlers) : this(handlers)
{
if (baseUri == null)
@@ -127,6 +130,9 @@ protected AutoRestDurationTestService(Uri baseUri, params DelegatingHandler[] ha
///
/// Optional. The delegating handlers to add to the http client pipeline.
///
+ ///
+ /// Thrown when a required parameter is null
+ ///
protected AutoRestDurationTestService(Uri baseUri, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers)
{
if (baseUri == null)
@@ -145,6 +151,9 @@ protected AutoRestDurationTestService(Uri baseUri, HttpClientHandler rootHandler
///
/// Optional. The delegating handlers to add to the http client pipeline.
///
+ ///
+ /// Thrown when a required parameter is null
+ ///
public AutoRestDurationTestService(ServiceClientCredentials credentials, params DelegatingHandler[] handlers) : this(handlers)
{
if (credentials == null)
@@ -170,6 +179,9 @@ public AutoRestDurationTestService(ServiceClientCredentials credentials, params
///
/// Optional. The delegating handlers to add to the http client pipeline.
///
+ ///
+ /// Thrown when a required parameter is null
+ ///
public AutoRestDurationTestService(ServiceClientCredentials credentials, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers)
{
if (credentials == null)
@@ -195,6 +207,9 @@ public AutoRestDurationTestService(ServiceClientCredentials credentials, HttpCli
///
/// Optional. The delegating handlers to add to the http client pipeline.
///
+ ///
+ /// Thrown when a required parameter is null
+ ///
public AutoRestDurationTestService(Uri baseUri, ServiceClientCredentials credentials, params DelegatingHandler[] handlers) : this(handlers)
{
if (baseUri == null)
@@ -228,6 +243,9 @@ public AutoRestDurationTestService(Uri baseUri, ServiceClientCredentials credent
///
/// Optional. The delegating handlers to add to the http client pipeline.
///
+ ///
+ /// Thrown when a required parameter is null
+ ///
public AutoRestDurationTestService(Uri baseUri, ServiceClientCredentials credentials, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers)
{
if (baseUri == null)
diff --git a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/AzureBodyDurationAllSync/DurationOperations.cs b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/AzureBodyDurationAllSync/DurationOperations.cs
index 81ec07668d7d3..80a7a22c836ff 100644
--- a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/AzureBodyDurationAllSync/DurationOperations.cs
+++ b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/AzureBodyDurationAllSync/DurationOperations.cs
@@ -35,6 +35,9 @@ internal partial class DurationOperations : IServiceOperations
/// Reference to the service client.
///
+ ///
+ /// Thrown when a required parameter is null
+ ///
internal DurationOperations(AutoRestDurationTestService client)
{
if (client == null)
@@ -58,6 +61,12 @@ internal DurationOperations(AutoRestDurationTestService client)
///
/// The cancellation token.
///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
///
/// A response object containing the response body and response headers.
///
@@ -206,6 +215,9 @@ internal DurationOperations(AutoRestDurationTestService client)
///
/// The cancellation token.
///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
///
/// A response object containing the response body and response headers.
///
@@ -338,6 +350,12 @@ internal DurationOperations(AutoRestDurationTestService client)
///
/// The cancellation token.
///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
///
/// A response object containing the response body and response headers.
///
@@ -484,6 +502,12 @@ internal DurationOperations(AutoRestDurationTestService client)
///
/// The cancellation token.
///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
///
/// A response object containing the response body and response headers.
///
diff --git a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/AzureBodyDurationAllSync/IDurationOperations.cs b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/AzureBodyDurationAllSync/IDurationOperations.cs
index 08caf84df02cc..b44f43b7bb574 100644
--- a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/AzureBodyDurationAllSync/IDurationOperations.cs
+++ b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/AzureBodyDurationAllSync/IDurationOperations.cs
@@ -31,6 +31,12 @@ public partial interface IDurationOperations
///
/// The cancellation token.
///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
Task> GetNullWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
///
/// Put a positive duration value
@@ -43,6 +49,9 @@ public partial interface IDurationOperations
///
/// The cancellation token.
///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
Task PutPositiveDurationWithHttpMessagesAsync(TimeSpan durationBody, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
///
/// Get a positive duration value
@@ -53,6 +62,12 @@ public partial interface IDurationOperations
///
/// The cancellation token.
///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
Task> GetPositiveDurationWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
///
/// Get an invalid duration value
@@ -63,6 +78,12 @@ public partial interface IDurationOperations
///
/// The cancellation token.
///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
Task> GetInvalidWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
}
}
diff --git a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/AzureBodyDurationAllSync/Models/ErrorException.cs b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/AzureBodyDurationAllSync/Models/ErrorException.cs
index 8b02d920b4721..ed7672915ae15 100644
--- a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/AzureBodyDurationAllSync/Models/ErrorException.cs
+++ b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/AzureBodyDurationAllSync/Models/ErrorException.cs
@@ -81,6 +81,9 @@ protected ErrorException(SerializationInfo info, StreamingContext context)
///
/// Serialization info.
/// Streaming context.
+ ///
+ /// Thrown when a required parameter is null
+ ///
[SecurityPermission(SecurityAction.Demand, SerializationFormatter = true)]
public override void GetObjectData(SerializationInfo info, StreamingContext context)
{
diff --git a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/AzureBodyDurationNoSync/AutoRestDurationTestService.cs b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/AzureBodyDurationNoSync/AutoRestDurationTestService.cs
index 8adef14be4bbf..bd9a8b84b5717 100644
--- a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/AzureBodyDurationNoSync/AutoRestDurationTestService.cs
+++ b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/AzureBodyDurationNoSync/AutoRestDurationTestService.cs
@@ -106,6 +106,9 @@ protected AutoRestDurationTestService(HttpClientHandler rootHandler, params Dele
///
/// Optional. The delegating handlers to add to the http client pipeline.
///
+ ///
+ /// Thrown when a required parameter is null
+ ///
protected AutoRestDurationTestService(Uri baseUri, params DelegatingHandler[] handlers) : this(handlers)
{
if (baseUri == null)
@@ -127,6 +130,9 @@ protected AutoRestDurationTestService(Uri baseUri, params DelegatingHandler[] ha
///
/// Optional. The delegating handlers to add to the http client pipeline.
///
+ ///
+ /// Thrown when a required parameter is null
+ ///
protected AutoRestDurationTestService(Uri baseUri, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers)
{
if (baseUri == null)
@@ -145,6 +151,9 @@ protected AutoRestDurationTestService(Uri baseUri, HttpClientHandler rootHandler
///
/// Optional. The delegating handlers to add to the http client pipeline.
///
+ ///
+ /// Thrown when a required parameter is null
+ ///
public AutoRestDurationTestService(ServiceClientCredentials credentials, params DelegatingHandler[] handlers) : this(handlers)
{
if (credentials == null)
@@ -170,6 +179,9 @@ public AutoRestDurationTestService(ServiceClientCredentials credentials, params
///
/// Optional. The delegating handlers to add to the http client pipeline.
///
+ ///
+ /// Thrown when a required parameter is null
+ ///
public AutoRestDurationTestService(ServiceClientCredentials credentials, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers)
{
if (credentials == null)
@@ -195,6 +207,9 @@ public AutoRestDurationTestService(ServiceClientCredentials credentials, HttpCli
///
/// Optional. The delegating handlers to add to the http client pipeline.
///
+ ///
+ /// Thrown when a required parameter is null
+ ///
public AutoRestDurationTestService(Uri baseUri, ServiceClientCredentials credentials, params DelegatingHandler[] handlers) : this(handlers)
{
if (baseUri == null)
@@ -228,6 +243,9 @@ public AutoRestDurationTestService(Uri baseUri, ServiceClientCredentials credent
///
/// Optional. The delegating handlers to add to the http client pipeline.
///
+ ///
+ /// Thrown when a required parameter is null
+ ///
public AutoRestDurationTestService(Uri baseUri, ServiceClientCredentials credentials, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers)
{
if (baseUri == null)
diff --git a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/AzureBodyDurationNoSync/DurationOperations.cs b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/AzureBodyDurationNoSync/DurationOperations.cs
index 44b091050b15c..df4eccfb9e740 100644
--- a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/AzureBodyDurationNoSync/DurationOperations.cs
+++ b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/AzureBodyDurationNoSync/DurationOperations.cs
@@ -35,6 +35,9 @@ internal partial class DurationOperations : IServiceOperations
/// Reference to the service client.
///
+ ///
+ /// Thrown when a required parameter is null
+ ///
internal DurationOperations(AutoRestDurationTestService client)
{
if (client == null)
@@ -58,6 +61,12 @@ internal DurationOperations(AutoRestDurationTestService client)
///
/// The cancellation token.
///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
///
/// A response object containing the response body and response headers.
///
@@ -206,6 +215,9 @@ internal DurationOperations(AutoRestDurationTestService client)
///
/// The cancellation token.
///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
///
/// A response object containing the response body and response headers.
///
@@ -338,6 +350,12 @@ internal DurationOperations(AutoRestDurationTestService client)
///
/// The cancellation token.
///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
///
/// A response object containing the response body and response headers.
///
@@ -484,6 +502,12 @@ internal DurationOperations(AutoRestDurationTestService client)
///
/// The cancellation token.
///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
///
/// A response object containing the response body and response headers.
///
diff --git a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/AzureBodyDurationNoSync/IDurationOperations.cs b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/AzureBodyDurationNoSync/IDurationOperations.cs
index 128a7a4cea18b..972bf10120453 100644
--- a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/AzureBodyDurationNoSync/IDurationOperations.cs
+++ b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/AzureBodyDurationNoSync/IDurationOperations.cs
@@ -31,6 +31,12 @@ public partial interface IDurationOperations
///
/// The cancellation token.
///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
Task> GetNullWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
///
/// Put a positive duration value
@@ -43,6 +49,9 @@ public partial interface IDurationOperations
///
/// The cancellation token.
///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
Task PutPositiveDurationWithHttpMessagesAsync(TimeSpan durationBody, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
///
/// Get a positive duration value
@@ -53,6 +62,12 @@ public partial interface IDurationOperations
///
/// The cancellation token.
///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
Task> GetPositiveDurationWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
///
/// Get an invalid duration value
@@ -63,6 +78,12 @@ public partial interface IDurationOperations
///
/// The cancellation token.
///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
Task> GetInvalidWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
}
}
diff --git a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/AzureBodyDurationNoSync/Models/ErrorException.cs b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/AzureBodyDurationNoSync/Models/ErrorException.cs
index 1902b5496c331..b06e7ea63c34c 100644
--- a/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/AzureBodyDurationNoSync/Models/ErrorException.cs
+++ b/AutoRest/Generators/CSharp/Azure.CSharp.Tests/Expected/AcceptanceTests/AzureBodyDurationNoSync/Models/ErrorException.cs
@@ -81,6 +81,9 @@ protected ErrorException(SerializationInfo info, StreamingContext context)
///
/// Serialization info.
/// Streaming context.
+ ///
+ /// Thrown when a required parameter is null
+ ///
[SecurityPermission(SecurityAction.Demand, SerializationFormatter = true)]
public override void GetObjectData(SerializationInfo info, StreamingContext context)
{
diff --git a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/Additional.Properties/Get.cs b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/Additional.Properties/Get.cs
index 9464df049aff0..b267924ae2711 100644
--- a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/Additional.Properties/Get.cs
+++ b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/Additional.Properties/Get.cs
@@ -34,6 +34,9 @@ public partial class Get : IServiceOperations, IGet
///
/// Reference to the service client.
///
+ ///
+ /// Thrown when a required parameter is null
+ ///
public Get(PetStoreonHeroku client)
{
if (client == null)
@@ -57,6 +60,12 @@ public Get(PetStoreonHeroku client)
///
/// The cancellation token.
///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
///
/// A response object containing the response body and response headers.
///
diff --git a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/Additional.Properties/IGet.cs b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/Additional.Properties/IGet.cs
index 8441b6544b9c1..f039849954692 100644
--- a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/Additional.Properties/IGet.cs
+++ b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/Additional.Properties/IGet.cs
@@ -30,6 +30,12 @@ public partial interface IGet
///
/// The cancellation token.
///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
Task>> PetsWithHttpMessagesAsync(int? limit = 11, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
}
}
diff --git a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/Additional.Properties/IPost.cs b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/Additional.Properties/IPost.cs
index 6b5423b4a4c25..7527bdbb26cb1 100644
--- a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/Additional.Properties/IPost.cs
+++ b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/Additional.Properties/IPost.cs
@@ -30,6 +30,12 @@ public partial interface IPost
///
/// The cancellation token.
///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
Task PetsWithHttpMessagesAsync(Pet pet, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
}
}
diff --git a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/Additional.Properties/IPut.cs b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/Additional.Properties/IPut.cs
index 79a1f17c9ec91..27a0184ae2956 100644
--- a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/Additional.Properties/IPut.cs
+++ b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/Additional.Properties/IPut.cs
@@ -30,6 +30,12 @@ public partial interface IPut
///
/// The cancellation token.
///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
Task PetsWithHttpMessagesAsync(Pet pet, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
}
}
diff --git a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/Additional.Properties/PetStoreonHeroku.cs b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/Additional.Properties/PetStoreonHeroku.cs
index ab5924a4b2821..a9022e7d68bba 100644
--- a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/Additional.Properties/PetStoreonHeroku.cs
+++ b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/Additional.Properties/PetStoreonHeroku.cs
@@ -93,6 +93,9 @@ public PetStoreonHeroku(HttpClientHandler rootHandler, params DelegatingHandler[
///
/// Optional. The delegating handlers to add to the http client pipeline.
///
+ ///
+ /// Thrown when a required parameter is null
+ ///
public PetStoreonHeroku(Uri baseUri, params DelegatingHandler[] handlers) : this(handlers)
{
if (baseUri == null)
@@ -114,6 +117,9 @@ public PetStoreonHeroku(Uri baseUri, params DelegatingHandler[] handlers) : this
///
/// Optional. The delegating handlers to add to the http client pipeline.
///
+ ///
+ /// Thrown when a required parameter is null
+ ///
public PetStoreonHeroku(Uri baseUri, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers)
{
if (baseUri == null)
diff --git a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/Additional.Properties/Post.cs b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/Additional.Properties/Post.cs
index 301d47eb8289b..dced68c50c487 100644
--- a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/Additional.Properties/Post.cs
+++ b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/Additional.Properties/Post.cs
@@ -34,6 +34,9 @@ public partial class Post : IServiceOperations, IPost
///
/// Reference to the service client.
///
+ ///
+ /// Thrown when a required parameter is null
+ ///
public Post(PetStoreonHeroku client)
{
if (client == null)
@@ -57,6 +60,12 @@ public Post(PetStoreonHeroku client)
///
/// The cancellation token.
///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
///
/// A response object containing the response body and response headers.
///
diff --git a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/Additional.Properties/Put.cs b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/Additional.Properties/Put.cs
index 9282fba3131a8..551085676fbb9 100644
--- a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/Additional.Properties/Put.cs
+++ b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/Additional.Properties/Put.cs
@@ -34,6 +34,9 @@ public partial class Put : IServiceOperations, IPut
///
/// Reference to the service client.
///
+ ///
+ /// Thrown when a required parameter is null
+ ///
public Put(PetStoreonHeroku client)
{
if (client == null)
@@ -57,6 +60,12 @@ public Put(PetStoreonHeroku client)
///
/// The cancellation token.
///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
///
/// A response object containing the response body and response headers.
///
diff --git a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/PetstoreV2AllSync/Models/Pet.cs b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/PetstoreV2AllSync/Models/Pet.cs
index 006deb06f472c..b60f2e5bb1e15 100644
--- a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/PetstoreV2AllSync/Models/Pet.cs
+++ b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/PetstoreV2AllSync/Models/Pet.cs
@@ -86,8 +86,11 @@ public Pet() { }
public string Status { get; set; }
///
- /// Validate the object. Throws ValidationException if validation fails.
+ /// Validate the object.
///
+ ///
+ /// Thrown if validation fails
+ ///
public virtual void Validate()
{
if (Name == null)
diff --git a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/PetstoreV2AllSync/SwaggerPetstoreV2.cs b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/PetstoreV2AllSync/SwaggerPetstoreV2.cs
index 2d744c04bc7f8..389a226b6a394 100644
--- a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/PetstoreV2AllSync/SwaggerPetstoreV2.cs
+++ b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/PetstoreV2AllSync/SwaggerPetstoreV2.cs
@@ -82,6 +82,9 @@ public SwaggerPetstoreV2(HttpClientHandler rootHandler, params DelegatingHandler
///
/// Optional. The delegating handlers to add to the http client pipeline.
///
+ ///
+ /// Thrown when a required parameter is null
+ ///
public SwaggerPetstoreV2(Uri baseUri, params DelegatingHandler[] handlers) : this(handlers)
{
if (baseUri == null)
@@ -103,6 +106,9 @@ public SwaggerPetstoreV2(Uri baseUri, params DelegatingHandler[] handlers) : thi
///
/// Optional. The delegating handlers to add to the http client pipeline.
///
+ ///
+ /// Thrown when a required parameter is null
+ ///
public SwaggerPetstoreV2(Uri baseUri, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers)
{
if (baseUri == null)
@@ -161,6 +167,15 @@ private void Initialize()
///
/// The cancellation token.
///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
///
/// A response object containing the response body and response headers.
///
@@ -286,6 +301,12 @@ private void Initialize()
///
/// The cancellation token.
///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
///
/// A response object containing the response body and response headers.
///
@@ -394,6 +415,15 @@ private void Initialize()
///
/// The cancellation token.
///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
///
/// A response object containing the response body and response headers.
///
@@ -520,6 +550,15 @@ private void Initialize()
///
/// The cancellation token.
///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
///
/// A response object containing the response body and response headers.
///
@@ -645,6 +684,12 @@ private void Initialize()
///
/// The cancellation token.
///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
///
/// A response object containing the response body and response headers.
///
@@ -766,6 +811,12 @@ private void Initialize()
///
/// The cancellation token.
///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
///
/// A response object containing the response body and response headers.
///
@@ -895,6 +946,9 @@ private void Initialize()
///
/// The cancellation token.
///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
///
/// A response object containing the response body and response headers.
///
@@ -996,6 +1050,12 @@ private void Initialize()
///
/// The cancellation token.
///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
///
/// A response object containing the response body and response headers.
///
@@ -1106,6 +1166,15 @@ private void Initialize()
///
/// The cancellation token.
///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
///
/// A response object containing the response body and response headers.
///
@@ -1229,6 +1298,15 @@ private void Initialize()
///
/// The cancellation token.
///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
///
/// A response object containing the response body and response headers.
///
@@ -1358,6 +1436,12 @@ private void Initialize()
///
/// The cancellation token.
///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
///
/// A response object containing the response body and response headers.
///
@@ -1464,6 +1548,12 @@ private void Initialize()
///
/// The cancellation token.
///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
///
/// A response object containing the response body and response headers.
///
@@ -1567,6 +1657,12 @@ private void Initialize()
///
/// The cancellation token.
///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
///
/// A response object containing the response body and response headers.
///
@@ -1670,6 +1766,12 @@ private void Initialize()
///
/// The cancellation token.
///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
///
/// A response object containing the response body and response headers.
///
@@ -1776,6 +1878,15 @@ private void Initialize()
///
/// The cancellation token.
///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
///
/// A response object containing the response body and response headers.
///
@@ -1919,6 +2030,9 @@ private void Initialize()
///
/// The cancellation token.
///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
///
/// A response object containing the response body and response headers.
///
@@ -2011,6 +2125,15 @@ private void Initialize()
///
/// The cancellation token.
///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
///
/// A response object containing the response body and response headers.
///
@@ -2131,6 +2254,12 @@ private void Initialize()
///
/// The cancellation token.
///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
///
/// A response object containing the response body and response headers.
///
@@ -2241,6 +2370,12 @@ private void Initialize()
///
/// The cancellation token.
///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
///
/// A response object containing the response body and response headers.
///
diff --git a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/PetstoreV2NoSync/Models/Pet.cs b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/PetstoreV2NoSync/Models/Pet.cs
index b49d6ed7eddc0..104eef1ad8983 100644
--- a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/PetstoreV2NoSync/Models/Pet.cs
+++ b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/PetstoreV2NoSync/Models/Pet.cs
@@ -86,8 +86,11 @@ public Pet() { }
public string Status { get; set; }
///
- /// Validate the object. Throws ValidationException if validation fails.
+ /// Validate the object.
///
+ ///
+ /// Thrown if validation fails
+ ///
public virtual void Validate()
{
if (Name == null)
diff --git a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/PetstoreV2NoSync/SwaggerPetstoreV2.cs b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/PetstoreV2NoSync/SwaggerPetstoreV2.cs
index 4a0b55bf23e4f..6dc2cc7192826 100644
--- a/AutoRest/Generators/CSharp/CSharp.Tests/Expected/PetstoreV2NoSync/SwaggerPetstoreV2.cs
+++ b/AutoRest/Generators/CSharp/CSharp.Tests/Expected/PetstoreV2NoSync/SwaggerPetstoreV2.cs
@@ -82,6 +82,9 @@ public SwaggerPetstoreV2(HttpClientHandler rootHandler, params DelegatingHandler
///
/// Optional. The delegating handlers to add to the http client pipeline.
///
+ ///
+ /// Thrown when a required parameter is null
+ ///
public SwaggerPetstoreV2(Uri baseUri, params DelegatingHandler[] handlers) : this(handlers)
{
if (baseUri == null)
@@ -103,6 +106,9 @@ public SwaggerPetstoreV2(Uri baseUri, params DelegatingHandler[] handlers) : thi
///
/// Optional. The delegating handlers to add to the http client pipeline.
///
+ ///
+ /// Thrown when a required parameter is null
+ ///
public SwaggerPetstoreV2(Uri baseUri, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers)
{
if (baseUri == null)
@@ -161,6 +167,15 @@ private void Initialize()
///
/// The cancellation token.
///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
///
/// A response object containing the response body and response headers.
///
@@ -286,6 +301,12 @@ private void Initialize()
///
/// The cancellation token.
///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
///
/// A response object containing the response body and response headers.
///
@@ -394,6 +415,15 @@ private void Initialize()
///
/// The cancellation token.
///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
///
/// A response object containing the response body and response headers.
///
@@ -520,6 +550,15 @@ private void Initialize()
///
/// The cancellation token.
///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
///
/// A response object containing the response body and response headers.
///
@@ -645,6 +684,12 @@ private void Initialize()
///
/// The cancellation token.
///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
///
/// A response object containing the response body and response headers.
///
@@ -766,6 +811,12 @@ private void Initialize()
///
/// The cancellation token.
///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
///
/// A response object containing the response body and response headers.
///
@@ -895,6 +946,9 @@ private void Initialize()
///
/// The cancellation token.
///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
///
/// A response object containing the response body and response headers.
///
@@ -996,6 +1050,12 @@ private void Initialize()
///
/// The cancellation token.
///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
///
/// A response object containing the response body and response headers.
///
@@ -1106,6 +1166,15 @@ private void Initialize()
///
/// The cancellation token.
///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
///
/// A response object containing the response body and response headers.
///
@@ -1229,6 +1298,15 @@ private void Initialize()
///
/// The cancellation token.
///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
///
/// A response object containing the response body and response headers.
///
@@ -1358,6 +1436,12 @@ private void Initialize()
///
/// The cancellation token.
///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
///
/// A response object containing the response body and response headers.
///
@@ -1464,6 +1548,12 @@ private void Initialize()
///
/// The cancellation token.
///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
///
/// A response object containing the response body and response headers.
///
@@ -1567,6 +1657,12 @@ private void Initialize()
///
/// The cancellation token.
///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
///
/// A response object containing the response body and response headers.
///
@@ -1670,6 +1766,12 @@ private void Initialize()
///
/// The cancellation token.
///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
///
/// A response object containing the response body and response headers.
///
@@ -1776,6 +1878,15 @@ private void Initialize()
///
/// The cancellation token.
///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
///
/// A response object containing the response body and response headers.
///
@@ -1919,6 +2030,9 @@ private void Initialize()
///
/// The cancellation token.
///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
///
/// A response object containing the response body and response headers.
///
@@ -2011,6 +2125,15 @@ private void Initialize()
///
/// The cancellation token.
///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
///
/// A response object containing the response body and response headers.
///
@@ -2131,6 +2254,12 @@ private void Initialize()
///
/// The cancellation token.
///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
///
/// A response object containing the response body and response headers.
///
@@ -2241,6 +2370,12 @@ private void Initialize()
///
/// The cancellation token.
///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
///
/// A response object containing the response body and response headers.
///
diff --git a/AutoRest/Generators/Extensions/Extensions.Tests/MappingTests.cs b/AutoRest/Generators/Extensions/Extensions.Tests/MappingTests.cs
index 3552847f2b1e6..0781bd6190d8f 100644
--- a/AutoRest/Generators/Extensions/Extensions.Tests/MappingTests.cs
+++ b/AutoRest/Generators/Extensions/Extensions.Tests/MappingTests.cs
@@ -11,7 +11,7 @@ namespace Microsoft.Rest.Generator.Tests
{
public class MappingExtensionsTests
{
- [Fact(Skip = "true")]
+ [Fact]
public void TestInputMapping()
{
var settings = new Settings
@@ -19,7 +19,7 @@ public void TestInputMapping()
Namespace = "Test",
Input = Path.Combine("Swagger", "swagger-payload-flatten.json"),
PayloadFlatteningThreshold = 3,
- OutputDirectory = "X:\\"
+ OutputDirectory = Path.GetTempPath()
};
settings.FileSystem = new MemoryFileSystem();
settings.FileSystem.WriteFile("AutoRest.json", File.ReadAllText("AutoRest.json"));
@@ -31,12 +31,11 @@ public void TestInputMapping()
CSharpCodeGenerator generator = new CSharpCodeGenerator(settings);
generator.NormalizeClientModel(clientModel);
generator.Generate(clientModel).GetAwaiter().GetResult();
- string body = settings.FileSystem.ReadFileAsText("X:\\Payload.cs");
+ string body = settings.FileSystem.ReadFileAsText(Path.Combine(settings.OutputDirectory, "Payload.cs"));
Assert.True(body.ContainsMultiline(@"
- MinProduct minProduct = default(MinProduct);
+ MinProduct minProduct = new MinProduct();
if (baseProductId != null || baseProductDescription != null || maxProductReference != null)
{
- minProduct = new MinProduct();
minProduct.BaseProductId = baseProductId;
minProduct.BaseProductDescription = baseProductDescription;
minProduct.MaxProductReference = maxProductReference;
diff --git a/gulpfile.js b/gulpfile.js
index 13dd7589b0b79..93e5313827216 100644
--- a/gulpfile.js
+++ b/gulpfile.js
@@ -626,7 +626,9 @@ gulp.task('test:python:azure', shell.task('tox', {cwd: './AutoRest/Generators/Py
var xunitTestsDlls = [
'AutoRest/AutoRest.Core.Tests/bin/Net45-Debug/AutoRest.Core.Tests.dll',
'AutoRest/Modelers/Swagger.Tests/bin/Net45-Debug/AutoRest.Modeler.Swagger.Tests.dll',
- 'AutoRest/Generators/Azure.Common/Azure.Common.Tests/bin/Net45-Debug/AutoRest.Generator.Azure.Common.Tests.dll'
+ 'AutoRest/Generators/Azure.Common/Azure.Common.Tests/bin/Net45-Debug/AutoRest.Generator.Azure.Common.Tests.dll',
+ 'AutoRest/Generators/Extensions/Extensions.Tests/bin/Net45-Debug/AutoRest.Generator.Extensions.Tests.dll',
+ 'AutoRest/Generators/Extensions/Azure.Extensions.Tests/bin/Net45-Debug/AutoRest.Generator.Azure.Extensions.Tests.dll'
];
var xunitNetCoreXproj = [