Skip to content

Commit b5cd8cc

Browse files
committed
New async APIs.
1 parent 25b4896 commit b5cd8cc

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

test/Serilog.Sinks.AzureTableStorageWithProperties.Tests/AzureTableStorageWithPropertiesSinkTests.cs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -54,14 +54,14 @@ public async Task WhenALoggerWritesToTheSinkItIsRetrievableFromTheTableWithPrope
5454
}
5555

5656
[Fact]
57-
public void WhenALoggerWritesToTheSinkWithAWindowsNewlineInTheTemplateItIsRetrievable()
57+
public async Task WhenALoggerWritesToTheSinkWithAWindowsNewlineInTheTemplateItIsRetrievable()
5858
{
5959
// Prompted from https://github.com/serilog/serilog-sinks-azuretablestorage/issues/10
6060
var storageAccount = CloudStorageAccount.DevelopmentStorageAccount;
6161
var tableClient = storageAccount.CreateCloudTableClient();
6262
var table = tableClient.GetTableReference("LogEventEntity");
6363

64-
table.DeleteIfExists();
64+
await table.DeleteIfExistsAsync();
6565

6666
var logger = new LoggerConfiguration()
6767
.WriteTo.AzureTableStorageWithProperties(storageAccount)
@@ -71,20 +71,20 @@ public void WhenALoggerWritesToTheSinkWithAWindowsNewlineInTheTemplateItIsRetrie
7171

7272
logger.Information(messageTemplate);
7373

74-
var result = table.ExecuteQuery(new TableQuery().Take(1)).FirstOrDefault();
74+
var result = (await TableQueryTakeDynamicAsync(table, takeCount: 1)).First();
7575

7676
Assert.NotNull(result);
7777
}
7878

7979
[Fact]
80-
public void WhenALoggerWritesToTheSinkWithALineFeedInTheTemplateItIsRetrievable()
80+
public async Task WhenALoggerWritesToTheSinkWithALineFeedInTheTemplateItIsRetrievable()
8181
{
8282
// Prompted from https://github.com/serilog/serilog-sinks-azuretablestorage/issues/10
8383
var storageAccount = CloudStorageAccount.DevelopmentStorageAccount;
8484
var tableClient = storageAccount.CreateCloudTableClient();
8585
var table = tableClient.GetTableReference("LogEventEntity");
8686

87-
table.DeleteIfExists();
87+
await table.DeleteIfExistsAsync();
8888

8989
var logger = new LoggerConfiguration()
9090
.WriteTo.AzureTableStorageWithProperties(storageAccount)
@@ -94,20 +94,20 @@ public void WhenALoggerWritesToTheSinkWithALineFeedInTheTemplateItIsRetrievable(
9494

9595
logger.Information(messageTemplate);
9696

97-
var result = table.ExecuteQuery(new TableQuery().Take(1)).FirstOrDefault();
97+
var result = (await TableQueryTakeDynamicAsync(table, takeCount: 1)).First();
9898

9999
Assert.NotNull(result);
100100
}
101101

102102
[Fact]
103-
public void WhenALoggerWritesToTheSinkWithACarriageReturnInTheTemplateItIsRetrievable()
103+
public async Task WhenALoggerWritesToTheSinkWithACarriageReturnInTheTemplateItIsRetrievable()
104104
{
105105
// Prompted from https://github.com/serilog/serilog-sinks-azuretablestorage/issues/10
106106
var storageAccount = CloudStorageAccount.DevelopmentStorageAccount;
107107
var tableClient = storageAccount.CreateCloudTableClient();
108108
var table = tableClient.GetTableReference("LogEventEntity");
109109

110-
table.DeleteIfExists();
110+
await table.DeleteIfExistsAsync();
111111

112112
var logger = new LoggerConfiguration()
113113
.WriteTo.AzureTableStorageWithProperties(storageAccount)
@@ -117,7 +117,7 @@ public void WhenALoggerWritesToTheSinkWithACarriageReturnInTheTemplateItIsRetrie
117117

118118
logger.Information(messageTemplate);
119119

120-
var result = table.ExecuteQuery(new TableQuery().Take(1)).FirstOrDefault();
120+
var result = (await TableQueryTakeDynamicAsync(table, takeCount: 1)).First();
121121

122122
Assert.NotNull(result);
123123
}

0 commit comments

Comments
 (0)