From c154fc5eba5ede7fc14c2984f45ccfe62de95274 Mon Sep 17 00:00:00 2001 From: John Lambert Date: Thu, 24 Oct 2024 20:01:54 -0400 Subject: [PATCH] Add pretranslation filtering to E2E test (would not catch it). --- src/Serval/test/Serval.E2ETests/ServalApiTests.cs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/Serval/test/Serval.E2ETests/ServalApiTests.cs b/src/Serval/test/Serval.E2ETests/ServalApiTests.cs index 5bca5c05..f9108934 100644 --- a/src/Serval/test/Serval.E2ETests/ServalApiTests.cs +++ b/src/Serval/test/Serval.E2ETests/ServalApiTests.cs @@ -115,14 +115,21 @@ public async Task NmtBatch() string[] books = ["MAT.txt", "1JN.txt", "2JN.txt"]; string cId1 = await _helperClient.AddTextCorpusToEngineAsync(engineId, books, "es", "en", false); _helperClient.TranslationBuildConfig.TrainOn = [new() { CorpusId = cId1, TextIds = ["1JN.txt"] }]; - string cId2 = await _helperClient.AddTextCorpusToEngineAsync(engineId, ["3JN.txt"], "es", "en", true); + string cId2 = await _helperClient.AddTextCorpusToEngineAsync( + engineId, + ["2JN.txt", "3JN.txt"], + "es", + "en", + true + ); + _helperClient.TranslationBuildConfig.Pretranslate = [new() { CorpusId = cId2, TextIds = ["2JN.txt"] }]; await _helperClient.BuildEngineAsync(engineId); await Task.Delay(1000); IList lTrans = await _helperClient.TranslationEnginesClient.GetAllPretranslationsAsync( engineId, cId2 ); - Assert.That(lTrans, Has.Count.EqualTo(14)); + Assert.That(lTrans, Has.Count.EqualTo(13)); // just 2 John } [Test]