mirror of
https://github.com/wabbajack-tools/wabbajack.git
synced 2024-08-30 18:42:17 +00:00
39 lines
1.3 KiB
C#
39 lines
1.3 KiB
C#
using System;
|
|
using System.Linq;
|
|
using System.Threading.Tasks;
|
|
using System.Windows.Documents;
|
|
using Octokit;
|
|
using Wabbajack.Common;
|
|
using Wabbajack.Lib.GitHub;
|
|
using Wabbajack.Lib.ModListRegistry;
|
|
using Xunit;
|
|
|
|
namespace Wabbajack.Test
|
|
{
|
|
public class GitHubTests
|
|
{
|
|
[Fact]
|
|
public async Task CanLogIntoGithub()
|
|
{
|
|
var client = await Wabbajack.Lib.GitHub.Client.Get();
|
|
var rnd = new Random();
|
|
var meta = new DownloadMetadata
|
|
{
|
|
Hash = Hash.FromLong(rnd.Next()),
|
|
NumberOfArchives = rnd.Next(100),
|
|
NumberOfInstalledFiles = rnd.Next(1000),
|
|
SizeOfInstalledFiles = rnd.Next(1000000)
|
|
};
|
|
await client.UpdateList("ci_tester", "ci_test", meta);
|
|
|
|
var updated = await client.GetData(Client.List.CI);
|
|
var lst = updated.Lists.FirstOrDefault(l => l.Links.MachineURL == "ci_test");
|
|
var newMeta = lst!.DownloadMetadata!;
|
|
Assert.Equal(meta.Hash, newMeta.Hash);
|
|
Assert.Equal(meta.NumberOfArchives, newMeta.NumberOfArchives);
|
|
Assert.Equal(meta.NumberOfInstalledFiles, newMeta.NumberOfInstalledFiles);
|
|
Assert.Equal(meta.SizeOfInstalledFiles, newMeta.SizeOfInstalledFiles);
|
|
}
|
|
}
|
|
}
|