Browse Source

Tests fixed.

pull/352/head
Sebastian Stehle 7 years ago
parent
commit
e24f983349
  1. 2
      src/Squidex.Infrastructure/Log/LockingLogStore.cs
  2. 4
      tests/Squidex.Infrastructure.Tests/InMemoryPubSubTests.cs
  3. 2
      tests/Squidex.Infrastructure.Tests/MongoDb/MongoExtensionsTests.cs

2
src/Squidex.Infrastructure/Log/LockingLogStore.cs

@ -56,7 +56,7 @@ namespace Squidex.Infrastructure.Log
{
await Task.Delay(2000, cts.Token);
}
catch (TaskCanceledException)
catch (OperationCanceledException)
{
break;
}

4
tests/Squidex.Infrastructure.Tests/InMemoryPubSubTests.cs

@ -81,13 +81,13 @@ namespace Squidex.Infrastructure
return x + x;
}, true);
await Assert.ThrowsAsync<TaskCanceledException>(() => sut.RequestAsync<int, int>(1, TimeSpan.FromSeconds(0.5), true));
await Assert.ThrowsAnyAsync<OperationCanceledException>(() => sut.RequestAsync<int, int>(1, TimeSpan.FromSeconds(0.5), true));
}
[Fact]
public async Task Should_timeout_when_nobody_responds()
{
await Assert.ThrowsAsync<TaskCanceledException>(() => sut.RequestAsync<int, int>(2, TimeSpan.FromSeconds(0.5), true));
await Assert.ThrowsAnyAsync<OperationCanceledException>(() => sut.RequestAsync<int, int>(2, TimeSpan.FromSeconds(0.5), true));
}
}
}

2
tests/Squidex.Infrastructure.Tests/MongoDb/MongoExtensionsTests.cs

@ -141,7 +141,7 @@ namespace Squidex.Infrastructure.MongoDb
var cursor = new Cursor<int>().Add(0).Add(1).Add(1).Add(2).Add(3).Add(5);
await Assert.ThrowsAsync<TaskCanceledException>(() =>
await Assert.ThrowsAnyAsync<OperationCanceledException>(() =>
{
return cursor.ForEachPipelineAsync(x =>
{

Loading…
Cancel
Save