yeet FluentAssertions (#3061)

This commit is contained in:
Mihail Gribkov
2025-01-25 23:10:59 +03:00
committed by GitHub
parent bb58d7188b
commit 52c2f0d918
17 changed files with 5 additions and 32 deletions

View File

@@ -1,6 +1,3 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using Xunit; using Xunit;
using Xunit.Abstractions; using Xunit.Abstractions;

View File

@@ -14,8 +14,8 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="FluentAssertions" Version="7.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" /> <PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
<PackageReference Include="Shouldly" Version="4.3.0" />
<PackageReference Include="xunit" Version="2.9.2" /> <PackageReference Include="xunit" Version="2.9.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2"> <PackageReference Include="xunit.runner.visualstudio" Version="2.8.2">
<PrivateAssets>all</PrivateAssets> <PrivateAssets>all</PrivateAssets>

View File

@@ -2,12 +2,13 @@ using Discord.API;
using Discord.API.Rest; using Discord.API.Rest;
using Discord.Net; using Discord.Net;
using Discord.Rest; using Discord.Rest;
using FluentAssertions;
using System; using System;
using System.IO; using System.IO;
using System.Threading.Tasks; using System.Threading.Tasks;
using Xunit; using Xunit;
using Shouldly;
namespace Discord; namespace Discord;
[CollectionDefinition(nameof(DiscordRestApiClientTests), DisableParallelization = true)] [CollectionDefinition(nameof(DiscordRestApiClientTests), DisableParallelization = true)]
@@ -47,7 +48,7 @@ public class DiscordRestApiClientTests : IClassFixture<RestGuildFixture>, IAsync
Func<Task> upload = async () => Func<Task> upload = async () =>
await _apiClient.UploadFileAsync(_channel.Id, new UploadFileParams(new FileAttachment(stream, "filename"))); await _apiClient.UploadFileAsync(_channel.Id, new UploadFileParams(new FileAttachment(stream, "filename")));
await upload.Should().ThrowExactlyAsync<HttpException>() var exception = await upload.ShouldThrowAsync<HttpException>();
.Where(e => e.DiscordCode == DiscordErrorCode.RequestEntityTooLarge); exception.DiscordCode.ShouldBe(DiscordErrorCode.RequestEntityTooLarge);
} }
} }

View File

@@ -1,6 +1,5 @@
using Discord.Rest; using Discord.Rest;
using System; using System;
using Xunit;
namespace Discord namespace Discord
{ {

View File

@@ -1,6 +1,4 @@
using System; using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using Xunit; using Xunit;
using Xunit.Abstractions; using Xunit.Abstractions;

View File

@@ -1,8 +1,5 @@
using Discord.Rest; using Discord.Rest;
using System;
using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text;
namespace Discord namespace Discord
{ {

View File

@@ -1,6 +1,4 @@
using System; using System;
using System.Collections.Generic;
using System.Text;
using Xunit; using Xunit;
namespace Discord namespace Discord

View File

@@ -1,5 +1,3 @@
using Discord;
using System;
using Xunit; using Xunit;
namespace Discord; namespace Discord;

View File

@@ -12,7 +12,6 @@
<ProjectReference Include="../../src/Discord.Net.WebSocket/Discord.Net.WebSocket.csproj" /> <ProjectReference Include="../../src/Discord.Net.WebSocket/Discord.Net.WebSocket.csproj" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="FluentAssertions" Version="7.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" /> <PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
<PackageReference Include="NSubstitute" Version="5.3.0" /> <PackageReference Include="NSubstitute" Version="5.3.0" />
<PackageReference Include="xunit" Version="2.9.2" /> <PackageReference Include="xunit" Version="2.9.2" />

View File

@@ -1,6 +1,4 @@
using System; using System;
using System.Collections.Generic;
using System.Text;
using Xunit; using Xunit;
namespace Discord namespace Discord

View File

@@ -1,6 +1,3 @@
using System;
using System.Collections.Generic;
using System.Text;
using Xunit; using Xunit;
namespace Discord namespace Discord

View File

@@ -1,5 +1,4 @@
using Discord.Rest; using Discord.Rest;
using NSubstitute;
using System; using System;
using Xunit; using Xunit;

View File

@@ -1,6 +1,5 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Text;
using Xunit; using Xunit;
namespace Discord namespace Discord

View File

@@ -1,6 +1,4 @@
using System; using System;
using System.Collections.Generic;
using System.Text;
using Xunit; using Xunit;
namespace Discord namespace Discord

View File

@@ -1,6 +1,4 @@
using System; using System;
using System.Collections.Generic;
using System.Text;
using Xunit; using Xunit;
namespace Discord namespace Discord

View File

@@ -1,6 +1,4 @@
using System; using System;
using System.Collections.Generic;
using System.Text;
using Xunit; using Xunit;
namespace Discord namespace Discord

View File

@@ -1,7 +1,6 @@
using Discord.Commands; using Discord.Commands;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using Xunit; using Xunit;