public void ParsesUSCultureProperlyForAppsInOtherCultures()
{
#if netcore
CultureInfo existingCulture = CultureInfo.CurrentCulture;
#else
CultureInfo existingCulture = CultureInfo.CurrentCulture;
#endif
try
{
#if netcore
CultureInfo.CurrentCulture = new CultureInfo("it-IT");
#else
Thread.CurrentThread.CurrentCulture = CultureInfo.GetCultureInfo("it-IT");
#endif
TestPlan plan = PlanFixture.ADD_ON_DISCOUNT_PLAN;
SubscriptionRequest request = new SubscriptionRequest
{
PaymentMethodToken = creditCard.Token,
PlanId = plan.Id,
Price = 100.0M
};
Result<Subscription> result = gateway.Subscription.Create(request);
Assert.IsTrue(result.IsSuccess());
Subscription subscription = result.Target;
Assert.AreEqual(100.00, subscription.Price);
Assert.AreEqual("100,00", subscription.Price.ToString());
}
finally
{
#if netcore
CultureInfo.CurrentCulture = existingCulture;
#else
Thread.CurrentThread.CurrentCulture = existingCulture;
#endif
}
}