* Culture Converter added
* space formatting
* Expected and actual argument reordered
* Removed to string
* Reference Converter and its test added
* fixing reference Converter
* Skipping test on framework
* CultureInfo added with others
* Removed Reference Connverter
Commit migrated from https://github.com/dotnet/corefx/commit/
c6115c50849d1524a26b2aa4c44e905a31570870
<Reference Include="System.Diagnostics.Tools" />
<Reference Include="System.Diagnostics.TraceSource" />
<Reference Include="System.Drawing.Primitives" />
+ <Reference Include="System.Globalization" />
<Reference Include="System.IO.FileSystem" />
<Reference Include="System.Linq" />
<Reference Include="System.Net.Primitives" />
using System.Collections.Generic;
using System.ComponentModel.Design;
using System.Diagnostics;
+using System.Drawing;
+using System.Globalization;
using System.Linq;
using System.Reflection;
-using System.Drawing;
using System.Threading;
namespace System.ComponentModel
[typeof(UInt64)] = typeof(UInt64Converter),
[typeof(object)] = typeof(TypeConverter),
[typeof(void)] = typeof(TypeConverter),
+ [typeof(CultureInfo)] = typeof(CultureInfoConverter),
[typeof(DateTime)] = typeof(DateTimeConverter),
[typeof(DateTimeOffset)] = typeof(DateTimeOffsetConverter),
[typeof(Decimal)] = typeof(DecimalConverter),
[typeof(ICollection)] = typeof(CollectionConverter),
[typeof(Enum)] = typeof(EnumConverter),
[s_intrinsicNullableKey] = typeof(NullableConverter),
- });
+ });
private static Hashtable PropertyCache => LazyInitializer.EnsureInitialized(ref s_propertyCache, () => new Hashtable());
c = (CultureInfo)converter.ConvertFrom(null, CultureInfo.InvariantCulture,
"nl-BE");
Assert.Equal(new CultureInfo("nl-BE"), c);
-
- try
+
+ try
{
// Linux can create such cultures
var cul = new CultureInfo("Dutch (Bel");
{
ArgumentException ex;
- try
+ try
{
// Linux can create such cultures
var cul = new CultureInfo("(default)");
}
}
- try
+ try
{
// Linux can create such cultures
var cul = new CultureInfo(" ");
}
}
- try
+ try
{
// Linux can create such cultures
var cul = new CultureInfo("\r\n");
Assert.Equal(3, values.Count);
}
}
-}
\ No newline at end of file
+}
// See the LICENSE file in the project root for more information.
using System.Collections;
+using System.Globalization;
using Xunit;
namespace System.ComponentModel.Tests
new Tuple<Type, Type> (typeof(IDerived), typeof(IBaseConverter)),
new Tuple<Type, Type> (typeof(ClassIBase), typeof(IBaseConverter)),
new Tuple<Type, Type> (typeof(ClassIDerived), typeof(IBaseConverter)),
- new Tuple<Type, Type> (typeof(Uri), typeof(UriTypeConverter))
+ new Tuple<Type, Type> (typeof(Uri), typeof(UriTypeConverter)),
+ new Tuple<Type, Type> (typeof(CultureInfo), typeof(CultureInfoConverter))
};
}
}