Add finance details export and translations

This commit is contained in:
2026-05-21 09:47:59 +02:00
parent b2ede7f8fd
commit 16449f1dc1
11 changed files with 890 additions and 28 deletions
@@ -44,6 +44,17 @@ public class ExcelExportServiceTests
Assert.Equal(2, includedGermanyRows.Count);
Assert.Equal(80m, includedGermanyRows.Sum(row => row.Cell(39).GetValue<decimal>()));
var details = workbook.Worksheet("Finance Details");
var includedGermanyDetailRows = details.RowsUsed()
.Where(row => row.RowNumber() > 4)
.Where(row => row.Cell(1).GetValue<int>() == 2025)
.Where(row => row.Cell(2).GetString() == "DE")
.ToList();
Assert.Equal(2, includedGermanyDetailRows.Count);
Assert.Equal(80m, includedGermanyDetailRows.Sum(row => row.Cell(5).GetValue<decimal>()));
Assert.All(includedGermanyDetailRows, row => Assert.Equal("Sales Price/Value", row.Cell(6).GetString()));
}
finally
{
@@ -129,7 +129,7 @@ public class ManualExcelDataSourceAdapterTests
public string LastResolvedTsc { get; private set; } = string.Empty;
public Task UploadAsync(string tenantId, string clientId, string clientSecret, string siteUrl, string exportFolder, string land, string localFilePath)
public Task UploadAsync(string tenantId, string clientId, string clientSecret, string siteUrl, string exportFolder, string land, string localFilePath, bool uploadTimestampedCopyIfLocked = false)
=> Task.CompletedTask;
public Task<string> DownloadToTempFileAsync(string tenantId, string clientId, string clientSecret, string siteUrl, string fileReference)
@@ -0,0 +1,27 @@
using TrafagSalesExporter.Services;
namespace TrafagSalesExporter.Tests;
public class UiTextServiceTests
{
[Fact]
public void Text_Returns_Selected_Language_Or_English_Fallback()
{
var service = new UiTextService();
Assert.Equal("Standorte", service.Text("Standorte", "Sites"));
service.SetLanguage("en");
Assert.Equal("Sites", service.Text("Standorte", "Sites"));
service.SetLanguage("es");
Assert.Equal("Sitios", service.Text("Standorte", "Sites"));
service.SetLanguage("it");
Assert.Equal("Sedi", service.Text("Standorte", "Sites"));
service.SetLanguage("hi");
Assert.Equal("साइटें", service.Text("Standorte", "Sites"));
Assert.Equal("Untranslated English", service.Text("Nicht uebersetzt", "Untranslated English"));
}
}