Skip to content

Commit 20b341b

Browse files
committed
refactor tests - start
1 parent 33fcad4 commit 20b341b

1 file changed

Lines changed: 26 additions & 0 deletions

File tree

src/NServiceBus.AzureFunctions.Analyzer.Tests/AzureFunctionsTransportAnalyzerTests.cs

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,32 @@ namespace NServiceBus.AzureFunctions.Analyzer.Tests
66
[TestFixture]
77
public class AzureFunctionsTransportAnalyzerTests : AnalyzerTestFixture<AzureFunctionsConfigurationAnalyzer>
88
{
9+
[TestCase("PrefetchCount", "5", AzureFunctionsDiagnostics.PrefetchCountNotAllowedId)]
10+
public Task DiagnosticIsReportedTransportConfiguration(string configName, string configValue, string diagnosticId)
11+
{
12+
var source =
13+
$@"using NServiceBus;
14+
using System;
15+
using System.Threading.Tasks;
16+
class Foo
17+
{{
18+
void Direct(ServiceBusTriggeredEndpointConfiguration endpointConfig)
19+
{{
20+
[|endpointConfig.Transport.{configName}|] = {configValue};
21+
22+
var transportConfig = endpointConfig.Transport;
23+
[|transportConfig.{configName}|] = {configValue};
24+
}}
25+
26+
void Extension(TransportExtensions<AzureServiceBusTransport> transportExtension)
27+
{{
28+
[|transportExtension.{configName}({configValue})|];
29+
}}
30+
}}";
31+
32+
return Assert(diagnosticId, source);
33+
}
34+
935
[Test]
1036
public Task DiagnosticIsReportedForPrefetchCount()
1137
{

0 commit comments

Comments
 (0)