mirror of
https://github.com/Tyrrrz/DiscordChatExporter.git
synced 2026-04-28 16:57:02 +00:00
Get rid of xUnit fixtures
This commit is contained in:
@@ -3,7 +3,6 @@ using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using CliFx.Infrastructure;
|
||||
using DiscordChatExporter.Cli.Commands;
|
||||
using DiscordChatExporter.Cli.Tests.Fixtures;
|
||||
using DiscordChatExporter.Cli.Tests.Infra;
|
||||
using DiscordChatExporter.Cli.Tests.TestData;
|
||||
using DiscordChatExporter.Cli.Tests.Utils;
|
||||
@@ -13,22 +12,14 @@ using Xunit;
|
||||
|
||||
namespace DiscordChatExporter.Cli.Tests.Specs;
|
||||
|
||||
[Collection(nameof(ExportWrapperCollection))]
|
||||
public class SelfContainedSpecs : IClassFixture<TempOutputFixture>
|
||||
public class SelfContainedSpecs
|
||||
{
|
||||
private readonly TempOutputFixture _tempOutput;
|
||||
|
||||
public SelfContainedSpecs(TempOutputFixture tempOutput)
|
||||
{
|
||||
_tempOutput = tempOutput;
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task Messages_in_self_contained_export_only_reference_local_file_resources()
|
||||
{
|
||||
// Arrange
|
||||
var filePath = _tempOutput.GetTempFilePath();
|
||||
var dirPath = Path.GetDirectoryName(filePath) ?? Directory.GetCurrentDirectory();
|
||||
using var dir = TempDir.Create();
|
||||
var filePath = Path.Combine(dir.Path, "output.html");
|
||||
|
||||
// Act
|
||||
await new ExportChannelsCommand
|
||||
@@ -45,7 +36,7 @@ public class SelfContainedSpecs : IClassFixture<TempOutputFixture>
|
||||
.Parse(await File.ReadAllTextAsync(filePath))
|
||||
.QuerySelectorAll("body [src]")
|
||||
.Select(e => e.GetAttribute("src")!)
|
||||
.Select(f => Path.GetFullPath(f, dirPath))
|
||||
.Select(f => Path.GetFullPath(f, dir.Path))
|
||||
.All(File.Exists)
|
||||
.Should()
|
||||
.BeTrue();
|
||||
|
||||
Reference in New Issue
Block a user