Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ottorinobruni committed May 12, 2024
1 parent 18086a2 commit dde6e76
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 27 deletions.
2 changes: 1 addition & 1 deletion TextCase/Converters/AlternateCaseConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public class AlternateCaseConverter : ICaseConverter
/// <returns>The specified text converted to alternate case.</returns>
public string Convert(string text)
{
if (string.IsNullOrEmpty(text))
if (string.IsNullOrWhiteSpace(text))
{
return string.Empty;
}
Expand Down
7 changes: 3 additions & 4 deletions TextCase/Converters/TitleCaseConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,9 @@ public class TitleCaseConverter : ICaseConverter
/// <returns>The specified text converted to title case.</returns>
public string Convert(string text)
{

return string.IsNullOrWhiteSpace(text) ?
string.Empty :
text.ToTitleCase();
return string.IsNullOrEmpty(text) ?
string.Empty :
CultureInfo.InvariantCulture.TextInfo.ToTitleCase(text);
}
}
}
40 changes: 18 additions & 22 deletions TextCase/TextCase.csproj
Original file line number Diff line number Diff line change
@@ -1,22 +1,18 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<PackageId>TextCase</PackageId>
<Version>1.0.6</Version>
<Authors>Ottorino Bruni</Authors>
<Description>The TextCase library for .NET helps changing the cases of existing texts.</Description>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<RepositoryUrl>https://github.com/ottorinobruni/TextCase</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageReadmeFile>README.md</PackageReadmeFile>

</PropertyGroup>


<ItemGroup>
<Folder Include="Extensions\" />
<None Include="..\README.md" Pack="true" PackagePath="\"/>
</ItemGroup>
</Project>
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<PackageId>TextCase</PackageId>
<Version>1.0.7</Version>
<Authors>Ottorino Bruni</Authors>
<Description>The TextCase library for .NET helps changing the cases of existing texts.</Description>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<RepositoryUrl>https://github.com/ottorinobruni/TextCase</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageReadmeFile>README.md</PackageReadmeFile>
</PropertyGroup>
<ItemGroup>
<Folder Include="Extensions\" />
<None Include="..\README.md" Pack="true" PackagePath="\" />
</ItemGroup>
</Project>

0 comments on commit dde6e76

Please sign in to comment.