1 using Microsoft.VisualStudio.TestTools.UnitTesting;
3 using System.Threading;
4 using System.Threading.Tasks;
20 public async Task
Run(CancellationToken cancellationToken)
28 var newModel =
new Api.Models.Byond
30 Version =
new Version(511, 1385)
33 Assert.IsNotNull(test.InstallJob);
34 Assert.IsNull(test.Version);
35 var job = test.InstallJob;
39 await Task.Delay(TimeSpan.FromSeconds(1), cancellationToken).ConfigureAwait(
false);
40 job = await
jobsClient.
GetId(job, cancellationToken).ConfigureAwait(
false);
43 while (!job.StoppedAt.HasValue && maxWait > 0);
44 if (!job.StoppedAt.HasValue)
47 Assert.Fail(
"Byond installation job timed out!");
50 if (job.ExceptionDetails !=
null)
51 Assert.Fail(job.ExceptionDetails);
54 Assert.AreEqual(newModel.Version, currentShit.Version);
61 Assert.IsNotNull(currentShit);
62 Assert.IsNull(currentShit.InstallJob);
63 Assert.IsNull(currentShit.Version);
64 var otherShit = await allVersionsTask.ConfigureAwait(
false);
65 Assert.IsNotNull(otherShit);
66 Assert.AreEqual(0, otherShit.Count);
For managing the Byond installation
Task< IReadOnlyList< Byond > > InstalledVersions(CancellationToken cancellationToken)
Get all installed Byond System.Versions
Task< Job > GetId(EntityId job, CancellationToken cancellationToken)
Get a job
readonly IJobsClient jobsClient
ByondTest(IByondClient byondClient, IJobsClient jobsClient)
async Task TestInstall511(CancellationToken cancellationToken)
readonly IByondClient byondClient
async Task TestNoVersion(CancellationToken cancellationToken)
Task< Byond > ActiveVersion(CancellationToken cancellationToken)
Get the Byond active System.Version information
Task< Byond > SetActiveVersion(Byond byond, CancellationToken cancellationToken)
Updates the Byond information
async Task Run(CancellationToken cancellationToken)
Task Cancel(Job job, CancellationToken cancellationToken)
Cancels a job