mirror of
https://github.com/bitwarden/server.git
synced 2025-12-10 15:55:10 -06:00
Resolve the failing test (#6622)
This commit is contained in:
parent
d1ae1fffd6
commit
3e12cfc6df
@ -1,4 +1,5 @@
|
|||||||
using Bit.Core.Billing.Extensions;
|
using System.Globalization;
|
||||||
|
using Bit.Core.Billing.Extensions;
|
||||||
using Stripe;
|
using Stripe;
|
||||||
using Xunit;
|
using Xunit;
|
||||||
|
|
||||||
@ -356,6 +357,15 @@ public class InvoiceExtensionsTests
|
|||||||
[Fact]
|
[Fact]
|
||||||
public void FormatForProvider_ComplexScenario_HandlesAllLineTypes()
|
public void FormatForProvider_ComplexScenario_HandlesAllLineTypes()
|
||||||
{
|
{
|
||||||
|
// Set culture to en-US to ensure consistent decimal formatting in tests
|
||||||
|
// This ensures tests pass on all machines regardless of system locale
|
||||||
|
var originalCulture = Thread.CurrentThread.CurrentCulture;
|
||||||
|
var originalUICulture = Thread.CurrentThread.CurrentUICulture;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US");
|
||||||
|
Thread.CurrentThread.CurrentUICulture = new CultureInfo("en-US");
|
||||||
|
|
||||||
// Arrange
|
// Arrange
|
||||||
var lineItems = new StripeList<InvoiceLineItem>();
|
var lineItems = new StripeList<InvoiceLineItem>();
|
||||||
lineItems.Data = new List<InvoiceLineItem>
|
lineItems.Data = new List<InvoiceLineItem>
|
||||||
@ -390,6 +400,12 @@ public class InvoiceExtensionsTests
|
|||||||
Assert.Equal("Custom Service", result[3]);
|
Assert.Equal("Custom Service", result[3]);
|
||||||
Assert.Equal("1 × Tax (at $2.00 / month)", result[4]);
|
Assert.Equal("1 × Tax (at $2.00 / month)", result[4]);
|
||||||
}
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
Thread.CurrentThread.CurrentCulture = originalCulture;
|
||||||
|
Thread.CurrentThread.CurrentUICulture = originalUICulture;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user