-
Notifications
You must be signed in to change notification settings - Fork 538
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Tests for double and decimal CellValue ctors (#906)
* change cellvalue ctors to use CultureInfo.InvariantCulture * add culture test for double and decimal CellValue ctor
- Loading branch information
Showing
2 changed files
with
80 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// Copyright (c) Microsoft. All rights reserved. | ||
// Licensed under the MIT license. See LICENSE file in the project root for full license information. | ||
|
||
using System; | ||
using System.Collections.Generic; | ||
using System.Globalization; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading; | ||
using System.Threading.Tasks; | ||
|
||
namespace DocumentFormat.OpenXml.Tests.Common | ||
{ | ||
internal readonly struct CultureInfoTester : IDisposable | ||
{ | ||
private readonly CultureInfo _old; | ||
|
||
public CultureInfoTester(string desired) | ||
{ | ||
_old = Thread.CurrentThread.CurrentCulture; | ||
Thread.CurrentThread.CurrentCulture = new CultureInfo(desired); | ||
} | ||
|
||
public void Dispose() | ||
{ | ||
Thread.CurrentThread.CurrentCulture = _old; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters