Skip to content

Commit 1dde674

Browse files
committed
Add workaround for end to end tests
1 parent fe0d655 commit 1dde674

File tree

3 files changed

+18
-3
lines changed

3 files changed

+18
-3
lines changed

src/Tests/.editorconfig

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[*.cs]
2+
3+
# xUnit1013: Public method should be marked as test
4+
dotnet_diagnostic.xUnit1013.severity = none

src/Tests/QueryTests.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,14 @@ public async Task CanGetAll()
4444
public async Task CanProject()
4545
{
4646
var account = CloudStorageAccount.DevelopmentStorageAccount;
47-
var repo = TableRepository.Create<Book>(account, nameof(CanProject), x => x.Author, x => x.ISBN);
47+
var repo = TableRepository.Create<Book>(account, $"{nameof(QueryTests)}{nameof(CanProject)}", x => x.Author, x => x.ISBN);
48+
49+
// For some reason, this test alone fails due to what looks like a timing issue in finishing creating the table
50+
while ((await account.CreateTableServiceClient().GetTableClient(repo.TableName).CreateIfNotExistsAsync()) != null)
51+
{
52+
await Task.Delay(50);
53+
}
54+
4855
await LoadBooksAsync(repo);
4956

5057
var hasResults = false;

src/Tests/RepositoryTests.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
using System;
22
using System.Collections.Generic;
33
using System.Threading.Tasks;
4+
using Azure;
45
using Azure.Data.Tables;
56
using Xunit;
7+
using Xunit.Abstractions;
68

79
namespace Devlooped
810
{
9-
public class RepositoryTests
11+
public record RepositoryTests(ITestOutputHelper Output)
1012
{
1113
[Fact]
1214
public async Task TableEndToEnd()
@@ -46,6 +48,8 @@ public async Task TableEndToEnd()
4648
public async Task TableRecordEndToEnd()
4749
{
4850
var repo = TableRepository.Create<AttributedRecordEntity>(CloudStorageAccount.DevelopmentStorageAccount);
51+
Output.WriteLine("Target table: " + repo.TableName);
52+
4953
var entity = await repo.PutAsync(new AttributedRecordEntity("Book", "1234"));
5054

5155
Assert.Equal("1234", entity.ID);
@@ -427,7 +431,7 @@ record RecordEntity(string Kind, string ID)
427431
public string? Status { get; set; }
428432
}
429433

430-
[Table("Record")]
434+
[Table("EntityRequest")]
431435
record AttributedRecordEntity([PartitionKey] string Kind, [RowKey] string ID)
432436
{
433437
public string? Status { get; set; }

0 commit comments

Comments
 (0)