From 963766e1901c8f9955cef8162a0ad1ad8774df0d Mon Sep 17 00:00:00 2001 From: Enkidu93 Date: Tue, 5 Dec 2023 16:00:50 -0500 Subject: [PATCH] More tests --- .../TranslationEngineTests.cs | 3 +- .../Services/PlatformServiceTests.cs | 39 +++++++++++++++++++ 2 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 tests/Serval.Translation.Tests/Services/PlatformServiceTests.cs diff --git a/tests/Serval.ApiServer.IntegrationTests/TranslationEngineTests.cs b/tests/Serval.ApiServer.IntegrationTests/TranslationEngineTests.cs index 3eb51656..9cfd1f4d 100644 --- a/tests/Serval.ApiServer.IntegrationTests/TranslationEngineTests.cs +++ b/tests/Serval.ApiServer.IntegrationTests/TranslationEngineTests.cs @@ -949,7 +949,8 @@ public async Task StartBuildForEngineByIdAsync(IEnumerable scope, int ex { Pretranslate = new List { ptcc }, TrainOn = new List { tcc }, - Options = "{\"max_steps\":10}" + Options = + "{\"max_steps\":10, \"use_key_terms\":false, \"some_double\":10.5, \"some_string\":\"string\"}" }; TranslationBuild resultAfterStart; Assert.ThrowsAsync(async () => diff --git a/tests/Serval.Translation.Tests/Services/PlatformServiceTests.cs b/tests/Serval.Translation.Tests/Services/PlatformServiceTests.cs new file mode 100644 index 00000000..2cfa34b6 --- /dev/null +++ b/tests/Serval.Translation.Tests/Services/PlatformServiceTests.cs @@ -0,0 +1,39 @@ +using Google.Protobuf.WellKnownTypes; +using MassTransit; +using Serval.Translation.V1; +using SIL.ObjectModel; + +namespace Serval.Translation.Services; + +[TestFixture] +public class PlatformServiceTests +{ + [Test] + public async Task TestBuildStateTransitionsAsync() { } + + [Test] + public async Task UpdateBuildStatusAsync() { } + + [Test] + public async Task IncrementCorpusSizeAsync() { } + + private class TestEnvironment + { + public TestEnvironment() + { + Builds = new MemoryRepository(); + Engines = new MemoryRepository(); + Pretranslations = new MemoryRepository(); + DataAccessContext = Substitute.For(); + PublishEndpoint = Substitute.For(); + ServerCallContext = Substitute.For(); + } + + public IRepository Builds { get; } + public IRepository Engines { get; } + public IRepository Pretranslations { get; } + public IDataAccessContext DataAccessContext { get; } + public IPublishEndpoint PublishEndpoint { get; } + public ServerCallContext ServerCallContext { get; } + } +}