Skip to content

Commit 6a3870d

Browse files
committed
Merge branch 'release/0.111.0'
2 parents 82556a5 + 5c56d8b commit 6a3870d

File tree

79 files changed

+601
-516
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+601
-516
lines changed

GitReleaseManager.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,10 @@ create:
44
footer-content: You can download this release from [nuget.org](https://www.nuget.org/packages/StrongGrid/{milestone})
55
footer-includes-milestone: true
66
milestone-replace-text: '{milestone}'
7+
include-contributors: true
78
close:
89
use-issue-comments: true
10+
set-due-date: true
911
issue-comment: |-
1012
:tada: This issue has been resolved in version {milestone} :tada:
1113

Source/StrongGrid.Benchmark/JsonParsingBenchmark.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public JsonParsingBenchmark()
2828
}
2929

3030
[Benchmark]
31-
public async Task SystemTextJson6()
31+
public async Task SystemTextJson()
3232
{
3333
var whitelistedIpAddresses = await _client.AccessManagement.GetWhitelistedIpAddressesAsync(null, CancellationToken.None).ConfigureAwait(false);
3434
var accessHistory = await _client.AccessManagement.GetAccessHistoryAsync(20, null, CancellationToken.None).ConfigureAwait(false);
@@ -48,7 +48,7 @@ public async Task SystemTextJson6()
4848
var legacyCategories = await _legacyClient.Categories.GetAsync(null, limit, offset, null, CancellationToken.None).ConfigureAwait(false);
4949
var legacyContacts = await _legacyClient.Contacts.GetAsync(recordsPerPage, page, null, CancellationToken.None).ConfigureAwait(false);
5050
var legacyCustomFields = await _legacyClient.CustomFields.GetAllAsync(null, CancellationToken.None).ConfigureAwait(false);
51-
var legacyLists = await _legacyClient.Lists.GetAllAsync(null, CancellationToken.None).ConfigureAwait(false);
51+
var legacyLists = await _legacyClient.Lists.GetAllAsync(cancellationToken: CancellationToken.None).ConfigureAwait(false);
5252
var legacySegments = await _legacyClient.Segments.GetAllAsync(null, CancellationToken.None).ConfigureAwait(false);
5353
var legacySenderIdentities = await _legacyClient.SenderIdentities.GetAllAsync(null, CancellationToken.None).ConfigureAwait(false);
5454
var authenticationDomains = await _client.SenderAuthentication.GetAllDomainsAsync(limit, offset, false, null, null, null, CancellationToken.None).ConfigureAwait(false);
@@ -76,7 +76,7 @@ private static MockHttpMessageHandler GetMockHttpMessageHandler()
7676
mockHttp.When(HttpMethod.Get, UnitTests.Utils.GetSendGridApiUri("suppression/bounces", "[email protected]")).Respond("application/json", UnitTests.Resources.BouncesTests.MULTIPLE_BOUNCES_JSON);
7777
mockHttp.When(HttpMethod.Get, UnitTests.Utils.GetSendGridApiUri("campaigns") + $"?limit={limit}&offset={offset}").Respond("application/json", UnitTests.Resources.CampaignsTests.MULTIPLE_CAMPAIGNS_JSON);
7878
mockHttp.When(HttpMethod.Get, UnitTests.Utils.GetSendGridApiUri("designs")).Respond("application/json", UnitTests.Resources.DesignsTests.MULTIPLE_DESIGNS_JSON);
79-
mockHttp.When(HttpMethod.Get, UnitTests.Utils.GetSendGridApiUri("messages") + $"?limit={limit}&query=").Respond("application/json", UnitTests.Resources.EmailActivitiesTests.MULTIPLE_MESSAGES_FOUND);
79+
mockHttp.When(HttpMethod.Get, UnitTests.Utils.GetSendGridApiUri("messages") + $"?limit={limit}").Respond("application/json", UnitTests.Resources.EmailActivitiesTests.MULTIPLE_MESSAGES_FOUND);
8080
mockHttp.When(HttpMethod.Post, UnitTests.Utils.GetSendGridApiUri("validations/email")).Respond("application/json", "{\"result\":" + UnitTests.Resources.EmailValidationTests.VALID_EMAIL_JSON + "}");
8181
mockHttp.When(HttpMethod.Get, UnitTests.Utils.GetSendGridApiUri("suppression/unsubscribes")).Respond("application/json", UnitTests.Resources.GlobalSuppressionTests.GLOBALLY_UNSUBSCRIBED);
8282
mockHttp.When(HttpMethod.Get, UnitTests.Utils.GetSendGridApiUri("suppression/invalid_emails") + $"?limit={limit}&offset={offset}").Respond("application/json", UnitTests.Resources.InvalidEmailsTests.MULTIPLE_INVALID_EMAILS_JSON);

Source/StrongGrid.Benchmark/StrongGrid.Benchmark.csproj

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFramework>net7.0</TargetFramework>
5+
<TargetFramework>net9.0</TargetFramework>
6+
<StartupObject>StrongGrid.Benchmark.Program</StartupObject>
67
</PropertyGroup>
78

89
<ItemGroup>
Lines changed: 34 additions & 118 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,10 @@
1-
using Logzio.DotNet.NLog;
2-
using Microsoft.ApplicationInsights.NLogTarget;
1+
using Formitable.BetterStack.Logger.Microsoft;
32
using Microsoft.Extensions.DependencyInjection;
43
using Microsoft.Extensions.Hosting;
54
using Microsoft.Extensions.Logging;
6-
using NLog;
7-
using NLog.Config;
8-
using NLog.Extensions.Logging;
9-
using NLog.Layouts;
10-
using NLog.Targets;
5+
using Microsoft.Extensions.Logging.Console;
116
using System;
127
using System.Linq;
13-
using System.Text;
148
using System.Threading;
159
using System.Threading.Tasks;
1610

@@ -22,9 +16,6 @@ public static async Task Main(string[] args)
2216
{
2317
var serializerContext = GenerateAttributesForSerializerContext();
2418

25-
var builder = Host.CreateApplicationBuilder();
26-
builder.Services.AddHostedService<TestsRunner>();
27-
2819
// Configure cancellation (this allows you to press CTRL+C or CTRL+Break to stop the integration tests)
2920
var cts = new CancellationTokenSource();
3021
Console.CancelKeyPress += (s, e) =>
@@ -33,16 +24,40 @@ public static async Task Main(string[] args)
3324
cts.Cancel();
3425
};
3526

36-
// Configure logging
37-
builder.Logging.ClearProviders(); // Remove the built-in providers (which include the Console)
38-
builder.Logging.AddNLog(GetNLogConfiguration()); // Add our desired custom providers (which include the Colored Console)
27+
var services = new ServiceCollection();
28+
ConfigureServices(services);
29+
using var serviceProvider = services.BuildServiceProvider();
30+
var app = serviceProvider.GetService<IHostedService>();
31+
await app.StartAsync(cts.Token).ConfigureAwait(false);
32+
}
3933

40-
// Run the tests
41-
var host = builder.Build();
42-
await host.StartAsync(cts.Token).ConfigureAwait(false);
34+
private static void ConfigureServices(ServiceCollection services)
35+
{
36+
services.AddHostedService<TestsRunner>();
4337

44-
// Stop NLog (which has the desirable side-effect of flushing any pending logs)
45-
LogManager.Shutdown();
38+
services
39+
.AddLogging(logging =>
40+
{
41+
var betterStackToken = Environment.GetEnvironmentVariable("BETTERSTACK_TOKEN");
42+
if (!string.IsNullOrEmpty(betterStackToken))
43+
{
44+
logging.AddBetterStackLogger(options =>
45+
{
46+
options.SourceToken = betterStackToken;
47+
options.Context["source"] = "ZoomNet_integration_tests";
48+
options.Context["StrongGrid-Version"] = StrongGrid.Client.Version;
49+
});
50+
}
51+
52+
logging.AddSimpleConsole(options =>
53+
{
54+
options.SingleLine = true;
55+
options.TimestampFormat = "yyyy-MM-dd HH:mm:ss ";
56+
});
57+
58+
logging.AddFilter(logLevel => logLevel >= LogLevel.Debug);
59+
logging.AddFilter<ConsoleLoggerProvider>(logLevel => logLevel >= LogLevel.Information);
60+
});
4661
}
4762

4863
private static string GenerateAttributesForSerializerContext()
@@ -85,104 +100,5 @@ private static string GenerateAttributesForSerializerContext()
85100
var result = string.Join("\r\n\r\n", [simpleAttributes, arrayAttributes, nullableAttributes]);
86101
return result;
87102
}
88-
89-
private static LoggingConfiguration GetNLogConfiguration()
90-
{
91-
// Configure logging
92-
var nLogConfig = new LoggingConfiguration();
93-
94-
// Send logs to logz.io
95-
var logzioToken = Environment.GetEnvironmentVariable("LOGZIO_TOKEN");
96-
if (!string.IsNullOrEmpty(logzioToken))
97-
{
98-
var logzioTarget = new LogzioTarget
99-
{
100-
Name = "Logzio",
101-
Token = logzioToken,
102-
LogzioType = "nlog",
103-
JsonKeysCamelCase = true,
104-
// ProxyAddress = "http://localhost:8888",
105-
};
106-
logzioTarget.ContextProperties.Add(new NLog.Targets.TargetPropertyWithContext("Source", "StrongGrid_integration_tests"));
107-
logzioTarget.ContextProperties.Add(new NLog.Targets.TargetPropertyWithContext("StrongGrid-Version", StrongGrid.Client.Version));
108-
109-
nLogConfig.AddTarget("Logzio", logzioTarget);
110-
nLogConfig.AddRule(NLog.LogLevel.Info, NLog.LogLevel.Fatal, logzioTarget, "*");
111-
}
112-
113-
// Send logs to Azure Insights
114-
var instrumentationKey = Environment.GetEnvironmentVariable("APPLICATIONINSIGHTS_INSTRUMENTATION_KEY");
115-
if (!string.IsNullOrEmpty(instrumentationKey))
116-
{
117-
var applicationInsightsTarget = new ApplicationInsightsTarget() { InstrumentationKey = instrumentationKey, Name = "StrongGrid" };
118-
applicationInsightsTarget.ContextProperties.Add(new Microsoft.ApplicationInsights.NLogTarget.TargetPropertyWithContext("Source", "StrongGrid_integration_tests"));
119-
applicationInsightsTarget.ContextProperties.Add(new Microsoft.ApplicationInsights.NLogTarget.TargetPropertyWithContext("StrongGrid-Version", StrongGrid.Client.Version));
120-
121-
nLogConfig.AddTarget("ApplicationInsights", applicationInsightsTarget);
122-
nLogConfig.AddRule(NLog.LogLevel.Info, NLog.LogLevel.Fatal, applicationInsightsTarget, "*");
123-
}
124-
125-
// Send logs to DataDog
126-
var datadogKey = Environment.GetEnvironmentVariable("DATADOG_APIKEY");
127-
if (!string.IsNullOrEmpty(datadogKey))
128-
{
129-
var datadogTarget = new WebServiceTarget("datadog")
130-
{
131-
Url = "https://http-intake.logs.us5.datadoghq.com/v1/input",
132-
Encoding = Encoding.UTF8,
133-
Protocol = WebServiceProtocol.JsonPost,
134-
PreAuthenticate = false
135-
};
136-
137-
// DD_API_KEY
138-
// Your Datadog API Key for sending your logs to Datadog.
139-
datadogTarget.Headers.Add(new MethodCallParameter("DD-API-KEY", Layout.FromString(datadogKey)));
140-
141-
// DD_SITE
142-
// The name of your Datadog site.Choose from one of the following examples:
143-
// Example: datadoghq.com(US1), datadoghq.eu(EU), us3.datadoghq.com(US3), us5.datadoghq.com(US5), ddog - gov.com(US1 - FED)
144-
// Default: datadoghq.com(US1)
145-
datadogTarget.Headers.Add(new MethodCallParameter("DD_SITE", Layout.FromString("us5.datadoghq.com(US5)")));
146-
147-
// DD_LOGS_DIRECT_SUBMISSION_INTEGRATIONS
148-
// Enables Agentless logging.Enable for your logging framework by setting to Serilog, NLog, Log4Net, or ILogger(for Microsoft.Extensions.Logging).
149-
// If you are using multiple logging frameworks, use a semicolon separated list of variables.
150-
// Example: Serilog; Log4Net; NLog
151-
datadogTarget.Headers.Add(new MethodCallParameter("DD_LOGS_DIRECT_SUBMISSION_INTEGRATIONS", Layout.FromString("NLog")));
152-
153-
// DD_LOGS_DIRECT_SUBMISSION_SOURCE
154-
// Sets the parsing rule for submitted logs.
155-
// Should always be set to csharp, unless you have a custom pipeline.
156-
// Default: csharp
157-
datadogTarget.Headers.Add(new MethodCallParameter("DD_LOGS_DIRECT_SUBMISSION_SOURCE", Layout.FromString("csharp")));
158-
159-
// DD_LOGS_DIRECT_SUBMISSION_MAX_BATCH_SIZE
160-
// Sets the maximum number of logs to send at one time.
161-
// Takes into account the limits in place for the API.
162-
// Default: 1000
163-
164-
// DD_LOGS_DIRECT_SUBMISSION_MAX_QUEUE_SIZE
165-
// Sets the maximum number of logs to hold in the internal queue at any one time before dropping log messages.
166-
// Default: 100000
167-
168-
// DD_LOGS_DIRECT_SUBMISSION_BATCH_PERIOD_SECONDS
169-
// Sets the time to wait(in seconds) before checking for new logs to send.
170-
// Default: 1
171-
172-
datadogTarget.Headers.Add(new MethodCallParameter("Content-Type", Layout.FromString("application/json")));
173-
datadogTarget.Headers.Add(new MethodCallParameter("Source", "StrongGrid_integration_tests"));
174-
datadogTarget.Headers.Add(new MethodCallParameter("StrongGrid-Version", StrongGrid.Client.Version));
175-
176-
nLogConfig.AddTarget("DataDog", datadogTarget);
177-
nLogConfig.AddRule(NLog.LogLevel.Info, NLog.LogLevel.Fatal, datadogTarget, "*");
178-
}
179-
180-
// Send logs to console
181-
var consoleTarget = new ColoredConsoleTarget();
182-
nLogConfig.AddTarget("ColoredConsole", consoleTarget);
183-
nLogConfig.AddRule(NLog.LogLevel.Info, NLog.LogLevel.Fatal, consoleTarget, "*");
184-
185-
return nLogConfig;
186-
}
187103
}
188104
}

Source/StrongGrid.IntegrationTests/StrongGrid.IntegrationTests.csproj

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFramework>net8.0</TargetFramework>
5+
<TargetFramework>net9.0</TargetFramework>
66
<AssemblyName>StrongGrid.IntegrationTests</AssemblyName>
77
<RootNamespace>StrongGrid.IntegrationTests</RootNamespace>
88
</PropertyGroup>
@@ -12,13 +12,11 @@
1212
</PropertyGroup>
1313

1414
<ItemGroup>
15-
<PackageReference Include="Logzio.DotNet.NLog" Version="1.2.0" />
16-
<PackageReference Include="Microsoft.ApplicationInsights.NLogTarget" Version="2.22.0" />
17-
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="8.0.0" />
18-
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.1" />
19-
<PackageReference Include="Microsoft.Extensions.Hosting" Version="8.0.1" />
20-
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="8.0.2" />
21-
<PackageReference Include="NLog.Extensions.Logging" Version="5.3.14" />
15+
<PackageReference Include="Formitable.BetterStack.Logger.Microsoft" Version="0.1.3-beta0002" />
16+
<PackageReference Include="Microsoft.Extensions.Diagnostics" Version="9.0.2" />
17+
<PackageReference Include="Microsoft.Extensions.Hosting.Abstractions" Version="9.0.2" />
18+
<PackageReference Include="Microsoft.Extensions.Logging" Version="9.0.2" />
19+
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="9.0.2" />
2220
</ItemGroup>
2321

2422
<ItemGroup>

Source/StrongGrid.IntegrationTests/Tests/ContactsAndCustomFields.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public async Task RunAsync(IClient client, TextWriter log, CancellationToken can
5454
//--------------------------------------------------
5555

5656
fields = await client.CustomFields.GetAllAsync(cancellationToken).ConfigureAwait(false);
57-
await log.WriteLineAsync($"All custom fields retrieved. There are {fields.Length} fields").ConfigureAwait(false);
57+
await log.WriteLineAsync($"All fields retrieved. There are {fields.OfType<ReservedFieldMetadata>().Count()} reserved fields and {fields.OfType<CustomFieldMetadata>().Count()} custom fields").ConfigureAwait(false);
5858

5959
var email = "[email protected]";
6060
var firstName = "John";

Source/StrongGrid.IntegrationTests/Tests/LegacyCampaignsAndSenderIdentities.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public async Task RunAsync(ILegacyClient client, TextWriter log, CancellationTok
5151
throw new Exception($"A verification email was previously sent to {sender.From.Email} but the process hasn't been completed yet (hint: there is a link in the email that you must click on).");
5252
}
5353

54-
var lists = await client.Lists.GetAllAsync(null, cancellationToken).ConfigureAwait(false);
54+
var lists = await client.Lists.GetAllAsync(cancellationToken: cancellationToken).ConfigureAwait(false);
5555
await log.WriteLineAsync($"All lists retrieved. There are {lists.Length} lists").ConfigureAwait(false);
5656

5757
var list = lists.FirstOrDefault(l => l.Name == "Integration testing list");

Source/StrongGrid.IntegrationTests/Tests/LegacyListsAndSegments.cs

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,29 +22,34 @@ public async Task RunAsync(ILegacyClient client, TextWriter log, CancellationTok
2222
await log.WriteLineAsync("\n***** LEGACY LISTS AND SEGMENTS *****\n").ConfigureAwait(false);
2323

2424
// GET LISTS
25-
var lists = await client.Lists.GetAllAsync(null, cancellationToken).ConfigureAwait(false);
25+
var lists = await client.Lists.GetAllAsync(cancellationToken: cancellationToken).ConfigureAwait(false);
2626
await log.WriteLineAsync($"All lists retrieved. There are {lists.Length} lists").ConfigureAwait(false);
2727

2828
// GET SEGMENTS
2929
var segments = await client.Segments.GetAllAsync(null, cancellationToken).ConfigureAwait(false);
3030
await log.WriteLineAsync($"All segements retrieved. There are {segments.Length} segments").ConfigureAwait(false);
3131

3232
// CLEANUP PREVIOUS INTEGRATION TESTS THAT MIGHT HAVE BEEN INTERRUPTED BEFORE THEY HAD TIME TO CLEANUP AFTER THEMSELVES
33-
var cleanUpTasks = lists
33+
// Please note: it's important to cleanup the segments first.
34+
// Otherwise we may get errors like this: "You cannot delete a list that is currently being used as a condition for an existing segment."
35+
var cleanUpTasks = segments
36+
.Where(s => s.Name.StartsWith("StrongGrid Integration Testing:"))
37+
.Select(async oldSegment =>
38+
{
39+
await client.Segments.DeleteAsync(oldSegment.Id, false, null, cancellationToken).ConfigureAwait(false);
40+
await log.WriteLineAsync($"Segment {oldSegment.Id} deleted").ConfigureAwait(false);
41+
await Task.Delay(250, cancellationToken).ConfigureAwait(false); // Brief pause to ensure SendGrid has time to catch up
42+
});
43+
await Task.WhenAll(cleanUpTasks).ConfigureAwait(false);
44+
45+
cleanUpTasks = lists
3446
.Where(l => l.Name.StartsWith("StrongGrid Integration Testing:"))
3547
.Select(async oldList =>
3648
{
3749
await client.Lists.DeleteAsync(oldList.Id, null, cancellationToken).ConfigureAwait(false);
3850
await log.WriteLineAsync($"List {oldList.Id} deleted").ConfigureAwait(false);
3951
await Task.Delay(250, cancellationToken).ConfigureAwait(false); // Brief pause to ensure SendGrid has time to catch up
40-
})
41-
.Union(segments.Where(s => s.Name.StartsWith("StrongGrid Integration Testing:"))
42-
.Select(async oldSegment =>
43-
{
44-
await client.Segments.DeleteAsync(oldSegment.Id, false, null, cancellationToken).ConfigureAwait(false);
45-
await log.WriteLineAsync($"Segment {oldSegment.Id} deleted").ConfigureAwait(false);
46-
await Task.Delay(250, cancellationToken).ConfigureAwait(false); // Brief pause to ensure SendGrid has time to catch up
47-
}));
52+
});
4853
await Task.WhenAll(cleanUpTasks).ConfigureAwait(false);
4954

5055
// CREATE A LIST

Source/StrongGrid.UnitTests/Resources/AccessManagementTests.cs

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
using System.Net;
88
using System.Net.Http;
99
using System.Text.Json;
10-
using System.Threading;
1110
using System.Threading.Tasks;
1211
using Xunit;
1312

@@ -124,7 +123,7 @@ public async Task GetAccessHistory()
124123
var accessManagement = new AccessManagement(client);
125124

126125
// Act
127-
var result = await accessManagement.GetAccessHistoryAsync(20, null, CancellationToken.None);
126+
var result = await accessManagement.GetAccessHistoryAsync(20, null, TestContext.Current.CancellationToken);
128127

129128
// Assert
130129
result.ShouldNotBeNull();
@@ -142,7 +141,7 @@ public async Task GetWhitelistedIpAddresses()
142141
var accessManagement = new AccessManagement(client);
143142

144143
// Act
145-
var result = await accessManagement.GetWhitelistedIpAddressesAsync(null, CancellationToken.None);
144+
var result = await accessManagement.GetWhitelistedIpAddressesAsync(null, TestContext.Current.CancellationToken);
146145

147146
// Assert
148147
result.ShouldNotBeNull();
@@ -162,7 +161,7 @@ public async Task AddIpAddressToWhitelist()
162161
var accessManagement = new AccessManagement(client);
163162

164163
// Act
165-
var result = await accessManagement.AddIpAddressToWhitelistAsync(ip, null, CancellationToken.None);
164+
var result = await accessManagement.AddIpAddressToWhitelistAsync(ip, null, TestContext.Current.CancellationToken);
166165

167166
// Assert
168167
result.ShouldNotBeNull();
@@ -181,7 +180,7 @@ public async Task AddIpAddressesToWhitelist()
181180
var accessManagement = new AccessManagement(client);
182181

183182
// Act
184-
var result = await accessManagement.AddIpAddressesToWhitelistAsync(ips, null, CancellationToken.None);
183+
var result = await accessManagement.AddIpAddressesToWhitelistAsync(ips, null, TestContext.Current.CancellationToken);
185184

186185
// Assert
187186
result.ShouldNotBeNull();
@@ -201,7 +200,7 @@ public async Task RemoveIpAddressFromWhitelistAsync()
201200
var accessManagement = new AccessManagement(client);
202201

203202
// Act
204-
await accessManagement.RemoveIpAddressFromWhitelistAsync(id, null, CancellationToken.None);
203+
await accessManagement.RemoveIpAddressFromWhitelistAsync(id, null, TestContext.Current.CancellationToken);
205204

206205
// Assert
207206
}
@@ -219,7 +218,7 @@ public async Task RemoveIpAddressesFromWhitelistAsync()
219218
var accessManagement = new AccessManagement(client);
220219

221220
// Act
222-
await accessManagement.RemoveIpAddressesFromWhitelistAsync(ids, null, CancellationToken.None);
221+
await accessManagement.RemoveIpAddressesFromWhitelistAsync(ids, null, TestContext.Current.CancellationToken);
223222

224223
// Assert
225224
}
@@ -239,7 +238,7 @@ public async Task GetWhitelistedIpAddressAsync()
239238
var accessManagement = new AccessManagement(client);
240239

241240
// Act
242-
var result = await accessManagement.GetWhitelistedIpAddressAsync(id, null, CancellationToken.None);
241+
var result = await accessManagement.GetWhitelistedIpAddressAsync(id, null, TestContext.Current.CancellationToken);
243242

244243
// Assert
245244
result.ShouldNotBeNull();

0 commit comments

Comments
 (0)