Skip to content

Commit

Permalink
SrkToolkit.Common: tinies
Browse files Browse the repository at this point in the history
  • Loading branch information
sandrock committed Aug 14, 2023
1 parent 13c91be commit 894ca73
Show file tree
Hide file tree
Showing 4 changed files with 123 additions and 110 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,12 @@ public class CultureInfoHelperTests
{
public class GetCountriesMethod
{
static IList<RegionInfo> countries = CultureInfoHelper.GetCountries();
private IList<RegionInfo> countries;

public GetCountriesMethod()
{
this.countries = CultureInfoHelper.GetCountries();
}

[Fact]
public void HasUK()
Expand Down
21 changes: 0 additions & 21 deletions Sources/SrkToolkit.Common.FxUnitTests/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,32 +4,11 @@
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("SrkToolkit.Common.FxUnitTests")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("SrkToolkit.Common.FxUnitTests")]
[assembly: AssemblyCopyright("Copyright © 2023")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]

// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("00457CE3-FE08-4AF2-972E-4C2EDD36F38D")]

// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
Original file line number Diff line number Diff line change
@@ -1,99 +1,127 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{00457CE3-FE08-4AF2-972E-4C2EDD36F38D}</ProjectGuid>
<ProjectTypeGuids>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>SrkToolkit.Common.FxUnitTests</RootNamespace>
<AssemblyName>SrkToolkit.Common.FxUnitTests</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFramework>net472</TargetFramework>
<ImplicitUsings>disable</ImplicitUsings>
<Nullable>disable</Nullable>

<IsPackable>false</IsPackable>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE;NETFRAMEWORK</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE;NETFRAMEWORK</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.ComponentModel.DataAnnotations" />
<Reference Include="System.Core" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="AssertTests.cs" />
<Compile Include="CompositeDisposableTests.cs" />
<Compile Include="CultureInfoHelperTests.cs" />
<Compile Include="DataAnnotations\CultureInfoAttributeTests.cs" />
<Compile Include="DataAnnotations\EmailAddressExAttributeTests.cs" />
<Compile Include="DataAnnotations\PhoneNumberAttributeTests.cs" />
<Compile Include="DataAnnotations\TimezoneAttributeTests.cs" />
<Compile Include="DataAnnotations\TwitterUsernameAttributeTests.cs" />
<Compile Include="DateRangeAttributeTests.cs" />
<Compile Include="DictionaryWrapperTests.cs" />
<Compile Include="DisaposableOnceTests.cs" />
<Compile Include="EmailAddressAttributeTests.cs" />
<Compile Include="EmailAddressTests.cs" />
<Compile Include="EnumStrings.Designer.cs" />
<Compile Include="EnumToolsTests.cs" />
<Compile Include="ObservableCollectionExtensionsTests.cs" />
<Compile Include="RetryLogicTests.NET4.cs" />
<Compile Include="SrkArrayExtensionsTests.cs" />
<Compile Include="SrkDateTimeExtensionsTests.cs" />
<Compile Include="SrkIDictionaryExtensionsTests.cs" />
<Compile Include="SrkIListExtensionsTests.cs" />
<Compile Include="SrkNameValueCollectionExtensions.cs" />
<Compile Include="SrkStringExtensionsTests.cs" />
<Compile Include="SrkStringTransformer.cs" />
<Compile Include="SrkTimeZoneInfoExtensionsTests.cs" />
<Compile Include="StringReplacerTests.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="ValidateTEsts.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\SrkToolkit.Common\SrkToolkit.Common.csproj">
<Project>{9442b344-fc0d-4a0b-be0e-d317c72f2a8e}</Project>
<Name>SrkToolkit.Common</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="EnumStrings.fr.resx" />
<EmbeddedResource Include="EnumStrings.resx" />
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.3.2" />
<PackageReference Include="Should" Version="1.1.20" />
<PackageReference Include="System.ComponentModel.Annotations" Version="4.4.1" />
<PackageReference Include="xunit" Version="2.4.2" />
<PackageReference Include="xunit.abstractions" Version="2.0.0" />
<PackageReference Include="xunit.assert" Version="2.1.0" />
<PackageReference Include="xunit.core" Version="2.1.0" />
<PackageReference Include="xunit.extensibility.core" Version="2.1.0" />
<PackageReference Include="xunit.extensibility.execution" Version="2.1.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="coverlet.collector" Version="3.1.2">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />

<ItemGroup>
<ProjectReference Include="..\SrkToolkit.Common\SrkToolkit.Common.csproj" />
</ItemGroup>

<ItemGroup>
<EmbeddedResource Update="EnumStrings.resx">
<Generator>PublicResXFileCodeGenerator</Generator>
</EmbeddedResource>
<EmbeddedResource Include="..\SrkToolkit.Common.CoreUnitTests\EnumStrings.fr.resx">
<Link>EnumStrings.fr.resx</Link>
</EmbeddedResource>
<EmbeddedResource Include="..\SrkToolkit.Common.CoreUnitTests\EnumStrings.resx">
<Link>EnumStrings.resx</Link>
</EmbeddedResource>
</ItemGroup>

<ItemGroup>
<Compile Include="..\SrkToolkit.Common.CoreUnitTests\AssertTests.cs">
<Link>AssertTests.cs</Link>
</Compile>
<Compile Include="..\SrkToolkit.Common.CoreUnitTests\CompositeDisposableTests.cs">
<Link>CompositeDisposableTests.cs</Link>
</Compile>
<Compile Include="..\SrkToolkit.Common.CoreUnitTests\CultureInfoHelperTests.cs">
<Link>CultureInfoHelperTests.cs</Link>
</Compile>
<Compile Include="..\SrkToolkit.Common.CoreUnitTests\DataAnnotations\CultureInfoAttributeTests.cs">
<Link>DataAnnotations\CultureInfoAttributeTests.cs</Link>
</Compile>
<Compile Include="..\SrkToolkit.Common.CoreUnitTests\DataAnnotations\EmailAddressExAttributeTests.cs">
<Link>DataAnnotations\EmailAddressExAttributeTests.cs</Link>
</Compile>
<Compile Include="..\SrkToolkit.Common.CoreUnitTests\DataAnnotations\PhoneNumberAttributeTests.cs">
<Link>DataAnnotations\PhoneNumberAttributeTests.cs</Link>
</Compile>
<Compile Include="..\SrkToolkit.Common.CoreUnitTests\DataAnnotations\TimezoneAttributeTests.cs">
<Link>DataAnnotations\TimezoneAttributeTests.cs</Link>
</Compile>
<Compile Include="..\SrkToolkit.Common.CoreUnitTests\DataAnnotations\TwitterUsernameAttributeTests.cs">
<Link>DataAnnotations\TwitterUsernameAttributeTests.cs</Link>
</Compile>
<Compile Include="..\SrkToolkit.Common.CoreUnitTests\DateRangeAttributeTests.cs">
<Link>DateRangeAttributeTests.cs</Link>
</Compile>
<Compile Include="..\SrkToolkit.Common.CoreUnitTests\DictionaryWrapperTests.cs">
<Link>DictionaryWrapperTests.cs</Link>
</Compile>
<Compile Include="..\SrkToolkit.Common.CoreUnitTests\DisaposableOnceTests.cs">
<Link>DisaposableOnceTests.cs</Link>
</Compile>
<Compile Include="..\SrkToolkit.Common.CoreUnitTests\EmailAddressAttributeTests.cs">
<Link>EmailAddressAttributeTests.cs</Link>
</Compile>
<Compile Include="..\SrkToolkit.Common.CoreUnitTests\EmailAddressTests.cs">
<Link>EmailAddressTests.cs</Link>
</Compile>
<Compile Include="..\SrkToolkit.Common.CoreUnitTests\EnumStrings.Designer.cs">
<Link>EnumStrings.Designer.cs</Link>
</Compile>
<Compile Include="..\SrkToolkit.Common.CoreUnitTests\EnumToolsTests.cs">
<Link>EnumToolsTests.cs</Link>
</Compile>
<Compile Include="..\SrkToolkit.Common.CoreUnitTests\ObservableCollectionExtensionsTests.cs">
<Link>ObservableCollectionExtensionsTests.cs</Link>
</Compile>
<Compile Include="..\SrkToolkit.Common.CoreUnitTests\RetryLogicTests.NET4.cs">
<Link>RetryLogicTests.NET4.cs</Link>
</Compile>
<Compile Include="..\SrkToolkit.Common.CoreUnitTests\SrkArrayExtensionsTests.cs">
<Link>SrkArrayExtensionsTests.cs</Link>
</Compile>
<Compile Include="..\SrkToolkit.Common.CoreUnitTests\SrkDateTimeExtensionsTests.cs">
<Link>SrkDateTimeExtensionsTests.cs</Link>
</Compile>
<Compile Include="..\SrkToolkit.Common.CoreUnitTests\SrkIDictionaryExtensionsTests.cs">
<Link>SrkIDictionaryExtensionsTests.cs</Link>
</Compile>
<Compile Include="..\SrkToolkit.Common.CoreUnitTests\SrkIListExtensionsTests.cs">
<Link>SrkIListExtensionsTests.cs</Link>
</Compile>
<Compile Include="..\SrkToolkit.Common.CoreUnitTests\SrkNameValueCollectionExtensions.cs">
<Link>SrkNameValueCollectionExtensions.cs</Link>
</Compile>
<Compile Include="..\SrkToolkit.Common.CoreUnitTests\SrkStringExtensionsTests.cs">
<Link>SrkStringExtensionsTests.cs</Link>
</Compile>
<Compile Include="..\SrkToolkit.Common.CoreUnitTests\SrkStringTransformer.cs">
<Link>SrkStringTransformer.cs</Link>
</Compile>
<Compile Include="..\SrkToolkit.Common.CoreUnitTests\SrkTimeZoneInfoExtensionsTests.cs">
<Link>SrkTimeZoneInfoExtensionsTests.cs</Link>
</Compile>
<Compile Include="..\SrkToolkit.Common.CoreUnitTests\StringReplacerTests.cs">
<Link>StringReplacerTests.cs</Link>
</Compile>
<Compile Include="..\SrkToolkit.Common.CoreUnitTests\ValidateTEsts.cs">
<Link>ValidateTEsts.cs</Link>
</Compile>
</ItemGroup>


</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ public static class CultureInfoHelper
/// Based on Windows CultureInfos, returns a list of all countries.
/// </summary>
/// <returns></returns>
[Obsolete("This method has unexpected results depending on the execution environment. Have your own unit tests to ensure the results are okay for you. ")]
public static IList<RegionInfo> GetCountries()
{
if (countriesCache.ContainsKey(CultureInfo.CurrentCulture))
Expand Down

0 comments on commit 894ca73

Please sign in to comment.