diff --git a/test/BraunauMobil.VeloBasar.Tests/BusinessLogic/TransactionServiceTests/GetAsync.cs b/test/BraunauMobil.VeloBasar.Tests/BusinessLogic/TransactionServiceTests/GetAsync.cs index f3f7b3a..a8b09c7 100644 --- a/test/BraunauMobil.VeloBasar.Tests/BusinessLogic/TransactionServiceTests/GetAsync.cs +++ b/test/BraunauMobil.VeloBasar.Tests/BusinessLogic/TransactionServiceTests/GetAsync.cs @@ -34,7 +34,7 @@ public async Task ByIdWithAmount_ShouldReturnTransactionWithIdAndChangeShouldBeA await Db.SaveChangesAsync(); // Act - TransactionEntity result = await Sut.GetAsync(toGet.Id); + TransactionEntity result = await Sut.GetAsync(toGet.Id, amountGiven); // Assert using (new AssertionScope()) diff --git a/test/BraunauMobil.VeloBasar.Tests/Mockups/StringLocalizerMock.cs b/test/BraunauMobil.VeloBasar.Tests/Mockups/StringLocalizerMock.cs index 1bd8924..3c27977 100644 --- a/test/BraunauMobil.VeloBasar.Tests/Mockups/StringLocalizerMock.cs +++ b/test/BraunauMobil.VeloBasar.Tests/Mockups/StringLocalizerMock.cs @@ -1,8 +1,9 @@ using Microsoft.Extensions.Localization; +using System.Text; namespace BraunauMobil.VeloBasar.Tests.Mockups; -public class StringLocalizerMock +public class StringLocalizerMock(IFormatProvider formatProvider) : IStringLocalizer { @@ -23,7 +24,18 @@ public LocalizedString this[string name] ArgumentNullException.ThrowIfNull(name); ArgumentNullException.ThrowIfNull(arguments); - string value = $"{name}_{string.Join('_', arguments)}"; + StringBuilder argsString = new(); + foreach (object argument in arguments) + { + string argString = string.Format(formatProvider, "{0}", argument); + if (argsString.Length > 0) + { + argsString.Append('_'); + } + argsString.Append(argString); + } + + string value = $"{name}_{argsString}"; return new(name, value); } } diff --git a/test/BraunauMobil.VeloBasar.Tests/X.cs b/test/BraunauMobil.VeloBasar.Tests/X.cs index 6889c17..77ca79c 100644 --- a/test/BraunauMobil.VeloBasar.Tests/X.cs +++ b/test/BraunauMobil.VeloBasar.Tests/X.cs @@ -10,7 +10,7 @@ public static class X public static IFormatProvider FormatProvider { get; } = CultureInfo.GetCultureInfo("de-AT"); - public static IStringLocalizer StringLocalizer { get; } = new StringLocalizerMock(); + public static IStringLocalizer StringLocalizer { get; } = new StringLocalizerMock(FormatProvider); public static Action CreateInspector(ServiceLifetime lifetime) => item =>