mirror of
https://github.com/tgstation/tgstation-server.git
synced 2026-08-23 21:16:52 +01:00
Fix tests
This commit is contained in:
@@ -66,6 +66,6 @@ namespace Tgstation.Server.Client
|
||||
/// </summary>
|
||||
/// <param name="instance">The <see cref="EntityId"/> of the <see cref="Instance"/> to create an <see cref="IInstanceClient"/> for</param>
|
||||
/// <returns>A new <see cref="IInstanceClient"/></returns>
|
||||
IInstanceClient CreateClient(EntityId instance);
|
||||
IInstanceClient CreateClient(Instance instance);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,11 +41,17 @@ namespace Tgstation.Server.Client
|
||||
public Task GrantPermissions(EntityId instance, CancellationToken cancellationToken) => ApiClient.Patch(Routes.SetID(Routes.InstanceManager, instance?.Id ?? throw new ArgumentNullException(nameof(instance))), cancellationToken);
|
||||
|
||||
/// <inheritdoc />
|
||||
public IInstanceClient CreateClient(EntityId instance) => new InstanceClient(
|
||||
ApiClient,
|
||||
new InstanceResponse
|
||||
{
|
||||
Id = instance?.Id ?? throw new ArgumentNullException(nameof(instance))
|
||||
});
|
||||
public IInstanceClient CreateClient(Instance instance)
|
||||
{
|
||||
if (instance == null)
|
||||
throw new ArgumentNullException(nameof(instance));
|
||||
|
||||
if (!instance.Id.HasValue)
|
||||
throw new ArgumentException("Instance missing Id!", nameof(instance));
|
||||
|
||||
return new InstanceClient(
|
||||
ApiClient,
|
||||
instance);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -202,7 +202,8 @@ namespace Tgstation.Server.Tests.Instance
|
||||
var discordBotReq = new ChatBotUpdateRequest
|
||||
{
|
||||
Id = ogDiscordBot.Id,
|
||||
Channels = ogDiscordBot.Channels.ToList()
|
||||
Channels = ogDiscordBot.Channels.ToList(),
|
||||
ChannelLimit = 1
|
||||
};
|
||||
|
||||
// We limited chat bots and channels to 1 and 2 respectively, try violating them
|
||||
|
||||
@@ -72,7 +72,7 @@ namespace Tgstation.Server.Tests.Instance
|
||||
await WaitForJob(clone.ActiveJob, 9000, false, null, cancellationToken).ConfigureAwait(false);
|
||||
var readAfterClone = await repositoryClient.Read(cancellationToken);
|
||||
|
||||
Assert.AreEqual(initalRepo.Origin, readAfterClone.Origin);
|
||||
Assert.AreEqual(cloneRequest.Origin, readAfterClone.Origin);
|
||||
Assert.AreEqual(workingBranch, readAfterClone.Reference);
|
||||
Assert.IsNotNull(readAfterClone.RevisionInformation);
|
||||
Assert.IsNotNull(readAfterClone.RevisionInformation.ActiveTestMerges);
|
||||
|
||||
@@ -134,6 +134,7 @@ namespace Tgstation.Server.Tests
|
||||
|
||||
group = await serverClient.Groups.Update(new UserGroupUpdateRequest
|
||||
{
|
||||
Id = groups.First().Id,
|
||||
PermissionSet = new PermissionSet
|
||||
{
|
||||
InstanceManagerRights = RightsHelper.AllRights<InstanceManagerRights>(),
|
||||
|
||||
Reference in New Issue
Block a user