diff --git a/src/Tgstation.Server.Client/Components/DreamDaemonClient.cs b/src/Tgstation.Server.Client/Components/DreamDaemonClient.cs index e0815a873b..10f72d0ffe 100644 --- a/src/Tgstation.Server.Client/Components/DreamDaemonClient.cs +++ b/src/Tgstation.Server.Client/Components/DreamDaemonClient.cs @@ -33,7 +33,7 @@ namespace Tgstation.Server.Client.Components public Task Shutdown(CancellationToken cancellationToken) => apiClient.Delete(Routes.DreamDaemon, instance.Id, cancellationToken); /// - public Task Start(CancellationToken cancellationToken) => apiClient.Create(Routes.DreamDaemon, instance.Id, cancellationToken); + public Task Start(CancellationToken cancellationToken) => apiClient.Create(Routes.DreamDaemon, instance.Id, cancellationToken); /// public Task Read(CancellationToken cancellationToken) => apiClient.Read(Routes.DreamDaemon, instance.Id, cancellationToken); diff --git a/src/Tgstation.Server.Client/Components/IDreamDaemonClient.cs b/src/Tgstation.Server.Client/Components/IDreamDaemonClient.cs index 0bb8a1d72b..764ddfbc23 100644 --- a/src/Tgstation.Server.Client/Components/IDreamDaemonClient.cs +++ b/src/Tgstation.Server.Client/Components/IDreamDaemonClient.cs @@ -21,7 +21,7 @@ namespace Tgstation.Server.Client.Components /// /// The for the operation /// A resulting in the information - Task Start(CancellationToken cancellationToken); + Task Start(CancellationToken cancellationToken); /// /// Shutdown diff --git a/src/Tgstation.Server.Client/Tgstation.Server.Client.csproj b/src/Tgstation.Server.Client/Tgstation.Server.Client.csproj index 34cf1a89d8..054656e7df 100644 --- a/src/Tgstation.Server.Client/Tgstation.Server.Client.csproj +++ b/src/Tgstation.Server.Client/Tgstation.Server.Client.csproj @@ -3,7 +3,7 @@ netstandard2.0 Full - 4.0.0.0-preview9107 + 4.0.0.0-preview9108 true Cyberboss /tg/station 13 @@ -24,6 +24,7 @@ true bin\Release\netstandard2.0\Tgstation.Server.Client.xml + 0 diff --git a/tests/Tgstation.Server.Client.Tests/Components/TestDreamDaemonClient.cs b/tests/Tgstation.Server.Client.Tests/Components/TestDreamDaemonClient.cs new file mode 100644 index 0000000000..a70423e97c --- /dev/null +++ b/tests/Tgstation.Server.Client.Tests/Components/TestDreamDaemonClient.cs @@ -0,0 +1,39 @@ +using Microsoft.VisualStudio.TestTools.UnitTesting; +using Moq; +using System; +using System.Collections.Generic; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +using Tgstation.Server.Api; +using Tgstation.Server.Api.Models; + +namespace Tgstation.Server.Client.Components.Tests +{ + [TestClass] + public sealed class TestDreamDaemonClient + { + [TestMethod] + public async Task TestStart() + { + var example = new Job + { + Id = 347, + StartedAt = DateTimeOffset.Now + }; + + var inst = new Instance + { + Id = 4958 + }; + + var mockApiClient = new Mock(); + mockApiClient.Setup(x => x.Create(Routes.DreamDaemon, inst.Id, It.IsAny())).Returns(Task.FromResult(example)); + + var client = new DreamDaemonClient(mockApiClient.Object, inst); + + var result = await client.Start(default).ConfigureAwait(false); + Assert.AreSame(example, result); + } + } +}