Skip to content

Commit 3b4df50

Browse files
devillclaude
andcommitted
Use invariant culture for decimal formatting in tests
Replace F2 format specifiers with explicit CultureInfo.InvariantCulture to ensure consistent decimal formatting across all locales and environments. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 916240b commit 3b4df50

5 files changed

Lines changed: 7 additions & 6 deletions

SpecRec.Tests/ContextSpecRecLogsTests.BasicSubstitutePattern.FlightBooking.verified.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@
2121
🔸 passengerCount: 2
2222
🔹 Returns: 12345
2323

24-
Returns: "Booked flight AA for 2 passengers, reservation #12345, price: 450,00"
24+
Returns: "Booked flight AA for 2 passengers, reservation #12345, price: 450.00"

SpecRec.Tests/ContextSpecRecLogsTests.BasicSubstitutePattern.verified.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@
2121
🔸 passengerCount: 1
2222
🔹 Returns: 54321
2323

24-
Returns: "Booked flight UA for 1 passengers, reservation #54321, price: 299,99"
24+
Returns: "Booked flight UA for 1 passengers, reservation #54321, price: 299.99"

SpecRec.Tests/ContextSpecRecLogsTests.ComplexIntegrationPattern.verified.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@
1515
🔸 amount: 99.99
1616
🔹 Returns: "Success - Payment Processed"
1717

18-
Returns: Order processed: 2x premium for 99,99
18+
Returns: Order processed: 2x premium for 99.99

SpecRec.Tests/ContextSpecRecLogsTests.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
using System.Globalization;
12
using Xunit;
23
using static SpecRec.GlobalObjectFactory;
34

@@ -218,7 +219,7 @@ public string BookFlight(int passengerCount, string airlineCode)
218219
var price = flightService.CalculatePrice(airlineCode, passengerCount);
219220
var reservationId = repository.CreateReservation(airlineCode, passengerCount);
220221

221-
return $"Booked flight {airlineCode} for {passengerCount} passengers, reservation #{reservationId}, price: {price:F2}";
222+
return $"Booked flight {airlineCode} for {passengerCount} passengers, reservation #{reservationId}, price: {price.ToString("F2", CultureInfo.InvariantCulture)}";
222223
}
223224
}
224225

@@ -337,7 +338,7 @@ public string ProcessOrder(string orderType, int quantity)
337338
if (paymentResult.StartsWith("Success"))
338339
{
339340
inventory.ReserveItems(orderType, quantity);
340-
return $"Order processed: {quantity}x {orderType} for {price:F2}";
341+
return $"Order processed: {quantity}x {orderType} for {price.ToString("F2", CultureInfo.InvariantCulture)}";
341342
}
342343

343344
return "Payment failed";

SpecRec.Tests/SpecRecExecutorIntegrationTests.BookFlight.EventCreation.verified.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@
2121
🔸 passengerCount: 2
2222
🔹 Returns: 12345
2323

24-
Returns: "Booked flight AA for 2 passengers, reservation #12345, price: 450,00"
24+
Returns: "Booked flight AA for 2 passengers, reservation #12345, price: 450.00"

0 commit comments

Comments
 (0)