예제 #1
0
        public void ConvertCorrectly(string culture, string locale, string value, decimal expectedResult)
        {
            // Arrange
            CultureHelper.CurrentCulture          = new CultureInfo(culture);
            CultureHelper.CurrentLocale           = new CultureInfo(locale);
            Thread.CurrentThread.CurrentUICulture = CultureHelper.CurrentCulture;
            var converter = new DecimalConverter();

            // Act
            decimal result = (decimal)converter.ConvertBack(value, null, null, Thread.CurrentThread.CurrentUICulture);

            // Assert
            result.Should().Be(expectedResult);
        }