|
@ -1,5 +1,7 @@ |
|
|
using System; |
|
|
using Microsoft.Extensions.Configuration; |
|
|
|
|
|
using System; |
|
|
using System.Globalization; |
|
|
using System.Globalization; |
|
|
|
|
|
using System.IO; |
|
|
using System.Text; |
|
|
using System.Text; |
|
|
|
|
|
|
|
|
namespace TestCases |
|
|
namespace TestCases |
|
@ -8,20 +10,27 @@ namespace TestCases |
|
|
{ |
|
|
{ |
|
|
public static StringComparison InvariantCultureIgnoreCase => StringComparison.OrdinalIgnoreCase; |
|
|
public static StringComparison InvariantCultureIgnoreCase => StringComparison.OrdinalIgnoreCase; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public class EncodingShim |
|
|
public class EncodingShim |
|
|
{ |
|
|
{ |
|
|
public static Encoding Default => Encoding.UTF8; |
|
|
public static Encoding Default => Encoding.UTF8; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public class AppSettingsShim |
|
|
public class AppSettingsShim |
|
|
{ |
|
|
{ |
|
|
public static string GetSetting(string name) |
|
|
public static string GetSetting(string name) |
|
|
{ |
|
|
{ |
|
|
if ("POI.testdata.path" == name) { |
|
|
var build = new ConfigurationBuilder() |
|
|
return AppContext.BaseDirectory; |
|
|
.SetBasePath(Directory.GetCurrentDirectory()) |
|
|
} |
|
|
.AddJsonFile("appsettings.json").Build(); |
|
|
throw new NotImplementedException(); |
|
|
|
|
|
|
|
|
return build.GetSection("POI.testdata.path").Value; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public class CultureShim |
|
|
public class CultureShim |
|
|
{ |
|
|
{ |
|
|
public static CultureInfo InstalledUICulture => CultureInfo.CurrentUICulture; |
|
|
public static CultureInfo InstalledUICulture => CultureInfo.CurrentUICulture; |
|
|