-
Notifications
You must be signed in to change notification settings - Fork 183
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
69 additions
and
189 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 51 additions & 0 deletions
51
src/dotnet/Azure.ClientSdk.Analyzers/Azure.ClientSdk.Analyzers.Tests/AZC0019Tests.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
|
||
using System.Threading.Tasks; | ||
using Xunit; | ||
using Verifier = Azure.ClientSdk.Analyzers.Tests.AzureAnalyzerVerifier<Azure.ClientSdk.Analyzers.ClientMethodsAnalyzer>; | ||
|
||
namespace Azure.ClientSdk.Analyzers.Tests | ||
{ | ||
public class AZC0019Tests | ||
{ | ||
[Fact] | ||
public async Task AZC0019ProducedForMethodsWithNoRequestContentButProtocolAndConvenience() | ||
{ | ||
const string code = @" | ||
using Azure; | ||
using Azure.Core; | ||
using System.Threading; | ||
using System.Threading.Tasks; | ||
using System.Collections.Generic; | ||
namespace RandomNamespace | ||
{ | ||
public class SomeClient | ||
{ | ||
public virtual Task<Response> GetAsync(string a, CancellationToken cancellationToken = default) | ||
{ | ||
return null; | ||
} | ||
public virtual Response Get(string a, CancellationToken cancellationToken = default) | ||
{ | ||
return null; | ||
} | ||
public virtual Task<Response> {|AZC0019:GetAsync|}(string a, Azure.RequestContext context = null) | ||
{ | ||
return null; | ||
} | ||
public virtual Response {|AZC0019:Get|}(string a, Azure.RequestContext context = null) | ||
{ | ||
return null; | ||
} | ||
} | ||
}"; | ||
await Verifier.CreateAnalyzer(code) | ||
.RunAsync(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters