mirror of
https://github.com/wabbajack-tools/wabbajack.git
synced 2024-08-30 18:42:17 +00:00
40 lines
1.1 KiB
C#
40 lines
1.1 KiB
C#
|
using System.Net;
|
|||
|
using System.Threading.Tasks;
|
|||
|
using Wabbajack.BuildServer.Test;
|
|||
|
using Wabbajack.Common;
|
|||
|
using Wabbajack.Lib;
|
|||
|
using Xunit;
|
|||
|
using Xunit.Abstractions;
|
|||
|
using Wabbajack.Common;
|
|||
|
|
|||
|
namespace Wabbajack.Server.Test
|
|||
|
{
|
|||
|
public class VirusCheckTests : ABuildServerSystemTest
|
|||
|
{
|
|||
|
public VirusCheckTests(ITestOutputHelper output, SingletonAdaptor<BuildServerFixture> fixture) : base(output, fixture)
|
|||
|
{
|
|||
|
}
|
|||
|
|
|||
|
[Fact]
|
|||
|
public async Task CheckVirus()
|
|||
|
{
|
|||
|
var tmpFile = new TempFile();
|
|||
|
|
|||
|
var meta = Game.SkyrimSpecialEdition.MetaData();
|
|||
|
var srcFile = meta.GameLocation().Combine(meta.MainExecutable!);
|
|||
|
|
|||
|
await srcFile.CopyToAsync(tmpFile.Path);
|
|||
|
|
|||
|
using (var s = await tmpFile.Path.OpenWrite())
|
|||
|
{
|
|||
|
s.Position = 1000;
|
|||
|
s.WriteByte(42);
|
|||
|
}
|
|||
|
|
|||
|
Assert.True(await VirusScanner.ShouldScan(tmpFile.Path));
|
|||
|
|
|||
|
Assert.Equal(VirusScanner.Result.NotMalware, await ClientAPI.GetVirusScanResult(tmpFile.Path));
|
|||
|
}
|
|||
|
}
|
|||
|
}
|