From 63e32c827a08a29792ab76670cb526056f285aec Mon Sep 17 00:00:00 2001 From: RiabushenkoA Date: Wed, 5 Feb 2025 16:07:59 +0200 Subject: [PATCH] Test fix --- .gitignore | 1 + Apps.Systran/Actions/DictionaryActions.cs | 2 +- Apps.Systran/Api/SystranClient.cs | 2 +- Tests.Systran/Tests.Systran.csproj | 3 +++ 4 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 582643d..0d43cfc 100644 --- a/.gitignore +++ b/.gitignore @@ -374,3 +374,4 @@ FodyWeavers.xsd /SystranTests/TestFiles/Translate_output.txt /SystranTests/TestFiles/Translate_output_translated.txt /Tests.Systran/appsettings.json +/Tests.Systran/appsettings.json diff --git a/Apps.Systran/Actions/DictionaryActions.cs b/Apps.Systran/Actions/DictionaryActions.cs index 40bb05a..7877644 100644 --- a/Apps.Systran/Actions/DictionaryActions.cs +++ b/Apps.Systran/Actions/DictionaryActions.cs @@ -55,7 +55,7 @@ public async Task CreateDictionary( importEntriesRequest.AddFile("inputFile", stream.ToArray(), "ConvertedDictionary.tsv", - "text/plain"); + "text/xml"); } var importResponse = await Client.ExecuteWithErrorHandling(importEntriesRequest); diff --git a/Apps.Systran/Api/SystranClient.cs b/Apps.Systran/Api/SystranClient.cs index e4994b4..fa519b3 100644 --- a/Apps.Systran/Api/SystranClient.cs +++ b/Apps.Systran/Api/SystranClient.cs @@ -30,7 +30,7 @@ protected override Exception ConfigureErrorException(RestResponse response) if (errors != null && !string.IsNullOrEmpty(errors.Message)) { - return new($"Systran API Error: {errors.Message}"); + throw new PluginApplicationException($"Systran API Error: {errors.Message}"); } return new("Unknown error"); diff --git a/Tests.Systran/Tests.Systran.csproj b/Tests.Systran/Tests.Systran.csproj index 9433502..660a130 100644 --- a/Tests.Systran/Tests.Systran.csproj +++ b/Tests.Systran/Tests.Systran.csproj @@ -27,6 +27,9 @@ + + PreserveNewest + PreserveNewest