Skip to content

Commit

Permalink
build(deps): bump xunit from 2.5.0 to 2.5.1 (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
dependabot[bot] authored Sep 26, 2023
1 parent 6395cfe commit bad30c9
Show file tree
Hide file tree
Showing 10 changed files with 134 additions and 226 deletions.
2 changes: 1 addition & 1 deletion Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<PackageVersion Include="NetEvolve.Extensions.XUnit" Version="1.1.74" />
<PackageVersion Include="System.Threading.Tasks.Extensions" Version="4.5.4" />
<PackageVersion Include="Verify.Xunit" Version="21.2.0" />
<PackageVersion Include="xunit" Version="2.5.0" />
<PackageVersion Include="xunit" Version="2.5.1" />
<PackageVersion Include="xunit.core" Version="2.5.1" />
<PackageVersion Include="xunit.runner.console" Version="2.5.0" />
<PackageVersion Include="xunit.runner.visualstudio" Version="2.5.1" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net5.0;net6.0;net7.0;net8.0</TargetFrameworks>
<TargetFrameworks>net6.0;net7.0;net8.0</TargetFrameworks>

<NoWarn>$(NoWarn);VSTHRD003;</NoWarn>
<NoWarn>$(NoWarn);VSTHRD003;NU1701;</NoWarn>

<SuppressTfmSupportBuildWarnings>true</SuppressTfmSupportBuildWarnings>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,28 +16,23 @@ public async Task WithTimeoutAsync_ParamTaskNull_ArgumentNullException()
{
Task task = null!;

_ = await Assert
.ThrowsAsync<ArgumentNullException>(
"task",
async () =>
await task!
.WithTimeoutAsync(TimeSpan.FromMilliseconds(100))
.ConfigureAwait(false)
)
.ConfigureAwait(false);
_ = await Assert.ThrowsAsync<ArgumentNullException>(
"task",
async () => await task!.WithTimeoutAsync(TimeSpan.FromMilliseconds(100))
);
}

[Fact]
public async Task WithTimeoutAsync_IsValidTrue_Expected()
{
var timeout = TimeSpan.FromMilliseconds(75);

var isValid = await TestMethod().WithTimeoutAsync(timeout).ConfigureAwait(false);
var isValid = await TestMethod().WithTimeoutAsync(timeout);
Assert.True(isValid);

static async Task TestMethod()
{
await Task.Delay(20).ConfigureAwait(false);
await Task.Delay(20);
return;
}
}
Expand All @@ -47,12 +42,12 @@ public async Task WithTimeoutAsync_IsValidFalse_Expected()
{
var timeout = TimeSpan.FromMilliseconds(20);

var isValid = await TestMethod().WithTimeoutAsync(timeout).ConfigureAwait(false);
var isValid = await TestMethod().WithTimeoutAsync(timeout);
Assert.False(isValid);

static async Task TestMethod()
{
await Task.Delay(75).ConfigureAwait(false);
await Task.Delay(75);
return;
}
}
Expand All @@ -62,7 +57,7 @@ public async Task WithTimeoutAsync_TaskAlreadyCompleted_Expected()
{
var timeout = TimeSpan.FromMilliseconds(100);

var isValid = await TestMethod().WithTimeoutAsync(timeout).ConfigureAwait(false);
var isValid = await TestMethod().WithTimeoutAsync(timeout);
Assert.True(isValid);

static Task TestMethod() => Task.CompletedTask;
Expand All @@ -73,12 +68,12 @@ public async Task WithTimeoutAsync_TimeoutInfinite_Expected()
{
var timeout = Timeout.InfiniteTimeSpan;

var isValid = await TestMethod().WithTimeoutAsync(timeout).ConfigureAwait(false);
var isValid = await TestMethod().WithTimeoutAsync(timeout);
Assert.True(isValid);

static async Task TestMethod()
{
await Task.Delay(75).ConfigureAwait(false);
await Task.Delay(75);
return;
}
}
Expand All @@ -88,12 +83,12 @@ public async Task WithTimeoutAsync_TimeoutZero_Expected()
{
var timeout = TimeSpan.Zero;

var isValid = await TestMethod().WithTimeoutAsync(timeout).ConfigureAwait(false);
var isValid = await TestMethod().WithTimeoutAsync(timeout);
Assert.False(isValid);

static async Task TestMethod()
{
await Task.Delay(75).ConfigureAwait(false);
await Task.Delay(75);
return;
}
}
Expand All @@ -103,16 +98,14 @@ public async Task WithTimeoutAsync_TimeoutMinusTwo_ThrowArgumentOutOfRangeExcept
{
var timeout = new TimeSpan(0, 0, 0, 0, -2);

_ = await Assert
.ThrowsAsync<ArgumentOutOfRangeException>(
"timeout",
async () => await TestMethod().WithTimeoutAsync(timeout).ConfigureAwait(false)
)
.ConfigureAwait(false);
_ = await Assert.ThrowsAsync<ArgumentOutOfRangeException>(
"timeout",
async () => await TestMethod().WithTimeoutAsync(timeout)
);

static async Task TestMethod()
{
await Task.Delay(75).ConfigureAwait(false);
await Task.Delay(75);
return;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,56 +16,40 @@ public async Task WithTimeoutAsync_ParamTaskNull_ArgumentNullException()
{
Task task = null!;

_ = await Assert
.ThrowsAsync<ArgumentNullException>(
"task",
async () => await task!.WithTimeoutAsync(100).ConfigureAwait(false)
)
.ConfigureAwait(false);
_ = await Assert.ThrowsAsync<ArgumentNullException>(
"task",
async () => await task!.WithTimeoutAsync(100)
);
}

[Fact]
public async Task WithTimeoutAsync_IsValidTrue_Expected()
{
var timeoutInMilliseconds = 75;

var isValid = await TestMethod()
.WithTimeoutAsync(timeoutInMilliseconds)
.ConfigureAwait(false);
var isValid = await TestMethod().WithTimeoutAsync(timeoutInMilliseconds);
Assert.True(isValid);

static async Task TestMethod()
{
await Task.Delay(20).ConfigureAwait(false);
return;
}
static Task TestMethod() => Task.Delay(20);
}

[Fact]
public async Task WithTimeoutAsync_IsValidFalse_Expected()
{
var timeoutInMilliseconds = 20;

var isValid = await TestMethod()
.WithTimeoutAsync(timeoutInMilliseconds)
.ConfigureAwait(false);
var isValid = await TestMethod().WithTimeoutAsync(timeoutInMilliseconds);
Assert.False(isValid);

static async Task TestMethod()
{
await Task.Delay(75).ConfigureAwait(false);
return;
}
static Task TestMethod() => Task.Delay(75);
}

[Fact]
public async Task WithTimeoutAsync_TaskAlreadyCompleted_Expected()
{
var timeoutInMilliseconds = 75;

var isValid = await TestMethod()
.WithTimeoutAsync(timeoutInMilliseconds)
.ConfigureAwait(false);
var isValid = await TestMethod().WithTimeoutAsync(timeoutInMilliseconds);
Assert.True(isValid);

static Task TestMethod() => Task.CompletedTask;
Expand All @@ -76,52 +60,33 @@ public async Task WithTimeoutAsync_TimeoutInfinite_Expected()
{
var timeoutInMilliseconds = Timeout.Infinite;

var isValid = await TestMethod()
.WithTimeoutAsync(timeoutInMilliseconds)
.ConfigureAwait(false);
var isValid = await TestMethod().WithTimeoutAsync(timeoutInMilliseconds);
Assert.True(isValid);

static async Task TestMethod()
{
await Task.Delay(75).ConfigureAwait(false);
return;
}
static Task TestMethod() => Task.Delay(75);
}

[Fact]
public async Task WithTimeoutAsync_TimeoutZero_Expected()
{
var timeoutInMilliseconds = 0;

var isValid = await TestMethod()
.WithTimeoutAsync(timeoutInMilliseconds)
.ConfigureAwait(false);
var isValid = await TestMethod().WithTimeoutAsync(timeoutInMilliseconds);
Assert.False(isValid);

static async Task TestMethod()
{
await Task.Delay(75).ConfigureAwait(false);
return;
}
static Task TestMethod() => Task.Delay(75);
}

[Fact]
public async Task WithTimeoutAsync_TimeoutMinusTwo_ThrowArgumentOutOfRangeException()
{
var timeoutInMilliseconds = -2;

_ = await Assert
.ThrowsAsync<ArgumentOutOfRangeException>(
"timeoutInMilliseconds",
async () =>
await TestMethod().WithTimeoutAsync(timeoutInMilliseconds).ConfigureAwait(false)
)
.ConfigureAwait(false);

static async Task TestMethod()
{
await Task.Delay(75).ConfigureAwait(false);
return;
}
_ = await Assert.ThrowsAsync<ArgumentOutOfRangeException>(
"timeoutInMilliseconds",
async () => await TestMethod().WithTimeoutAsync(timeoutInMilliseconds)
);

static Task TestMethod() => Task.Delay(75);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,29 +16,24 @@ public async Task WithTimeoutAsync_ParamTaskNull_ArgumentNullException()
{
Task<bool> task = null!;

_ = await Assert
.ThrowsAsync<ArgumentNullException>(
"task",
async () =>
await task!
.WithTimeoutAsync(TimeSpan.FromMilliseconds(100))
.ConfigureAwait(false)
)
.ConfigureAwait(false);
_ = await Assert.ThrowsAsync<ArgumentNullException>(
"task",
async () => await task!.WithTimeoutAsync(TimeSpan.FromMilliseconds(100))
);
}

[Fact]
public async Task WithTimeoutAsync_IsValidTrue_Expected()
{
var timeout = TimeSpan.FromMilliseconds(75);

var (isValid, result) = await TestMethod().WithTimeoutAsync(timeout).ConfigureAwait(false);
var (isValid, result) = await TestMethod().WithTimeoutAsync(timeout);
Assert.True(isValid);
Assert.Equal(1, result);

static async Task<int> TestMethod()
{
await Task.Delay(20).ConfigureAwait(false);
await Task.Delay(20);
return 1;
}
}
Expand All @@ -48,13 +43,13 @@ public async Task WithTimeoutAsync_IsValidFalse_Expected()
{
var timeout = TimeSpan.FromMilliseconds(20);

var (isValid, result) = await TestMethod().WithTimeoutAsync(timeout).ConfigureAwait(false);
var (isValid, result) = await TestMethod().WithTimeoutAsync(timeout);
Assert.False(isValid);
Assert.Equal(1, result);

static async Task<int> TestMethod()
{
await Task.Delay(75).ConfigureAwait(false);
await Task.Delay(75);
return 1;
}
}
Expand All @@ -64,7 +59,7 @@ public async Task WithTimeoutAsync_TaskAlreadyCompleted_Expected()
{
var timeout = TimeSpan.FromMilliseconds(20);

var (isValid, result) = await TestMethod().WithTimeoutAsync(timeout).ConfigureAwait(false);
var (isValid, result) = await TestMethod().WithTimeoutAsync(timeout);
Assert.True(isValid);
Assert.Equal(1, result);

Expand All @@ -76,13 +71,13 @@ public async Task WithTimeoutAsync_TimeoutInfinite_Expected()
{
var timeout = Timeout.InfiniteTimeSpan;

var (isValid, result) = await TestMethod().WithTimeoutAsync(timeout).ConfigureAwait(false);
var (isValid, result) = await TestMethod().WithTimeoutAsync(timeout);
Assert.True(isValid);
Assert.Equal(1, result);

static async Task<int> TestMethod()
{
await Task.Delay(75).ConfigureAwait(false);
await Task.Delay(75);
return 1;
}
}
Expand All @@ -92,13 +87,13 @@ public async Task WithTimeoutAsync_TimeoutZero_Expected()
{
var timeout = TimeSpan.Zero;

var (isValid, result) = await TestMethod().WithTimeoutAsync(timeout).ConfigureAwait(false);
var (isValid, result) = await TestMethod().WithTimeoutAsync(timeout);
Assert.False(isValid);
Assert.Equal(1, result);

static async Task<int> TestMethod()
{
await Task.Delay(75).ConfigureAwait(false);
await Task.Delay(75);
return 1;
}
}
Expand All @@ -108,16 +103,14 @@ public async Task WithTimeoutAsync_TimeoutMinusTwo_ThrowsArgumentOutOfRangeExcep
{
var timeout = new TimeSpan(0, 0, 0, 0, -2);

_ = await Assert
.ThrowsAsync<ArgumentOutOfRangeException>(
"timeout",
async () => await TestMethod().WithTimeoutAsync(timeout).ConfigureAwait(false)
)
.ConfigureAwait(false);
_ = await Assert.ThrowsAsync<ArgumentOutOfRangeException>(
"timeout",
async () => await TestMethod().WithTimeoutAsync(timeout)
);

static async Task<int> TestMethod()
{
await Task.Delay(75).ConfigureAwait(false);
await Task.Delay(75);
return 1;
}
}
Expand Down
Loading

0 comments on commit bad30c9

Please sign in to comment.