-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #17 from ottorinobruni/bug-remove-spaces
Bug remove spaces
- Loading branch information
Showing
23 changed files
with
531 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
using TextCase.Converters; | ||
using TextCase.Extensions; | ||
using Xunit; | ||
|
||
namespace TextCase.UnitTests | ||
{ | ||
public class CobolCaseConverterTest | ||
{ | ||
[Theory] | ||
[InlineData("hello world", "HELLO-WORLD")] | ||
[InlineData("icH bIn glückLICH", "ICH-BIN-GLÜCKLICH")] | ||
[InlineData("indent_style = space, 2-\nindent_size = 2", "INDENT-STYLE-SPACE-2\nINDENT-SIZE-2")] | ||
[InlineData("Hello World!", "HELLO-WORLD")] | ||
[InlineData("123 test", "123-TEST")] | ||
[InlineData("test with multiple spaces", "TEST-WITH-MULTIPLE-SPACES")] | ||
[InlineData("test_with_underscore", "TEST-WITH-UNDERSCORE")] | ||
[InlineData("test-with-dash", "TEST-WITH-DASH")] | ||
[InlineData("test.with.period", "TEST-WITH-PERIOD")] | ||
[InlineData("test/with/slash", "TEST-WITH-SLASH")] | ||
[InlineData("test\\with\\backslash", "TEST-WITH-BACKSLASH")] | ||
public void Convert_WhenConstantCase_TextShouldBeConstantCase(string input, string expected) | ||
{ | ||
// Setup | ||
var service = new CobolCaseConverter(); | ||
|
||
// Execute | ||
var actual = service.Convert(input); | ||
|
||
// Assert | ||
Assert.Equal(expected, actual); | ||
} | ||
|
||
[Theory] | ||
[InlineData("hello world", "HELLO-WORLD")] | ||
[InlineData("icH bIn glückLICH", "ICH-BIN-GLÜCKLICH")] | ||
[InlineData("indent_style = space, 2-\nindent_size = 2", "INDENT-STYLE-SPACE-2\nINDENT-SIZE-2")] | ||
[InlineData("Hello World!", "HELLO-WORLD")] | ||
[InlineData("123 test", "123-TEST")] | ||
[InlineData("test with multiple spaces", "TEST-WITH-MULTIPLE-SPACES")] | ||
[InlineData("test_with_underscore", "TEST-WITH-UNDERSCORE")] | ||
[InlineData("test-with-dash", "TEST-WITH-DASH")] | ||
[InlineData("test.with.period", "TEST-WITH-PERIOD")] | ||
[InlineData("test/with/slash", "TEST-WITH-SLASH")] | ||
[InlineData("test\\with\\backslash", "TEST-WITH-BACKSLASH")] | ||
public void ToCobolCase_WhenCobolCase_TextShouldBeCobolCase(string input, string output) | ||
{ | ||
// Execute | ||
var convertedText = input.ToCobolCase(); | ||
|
||
// Assert | ||
var expected = output; | ||
var actual = convertedText; | ||
Assert.Equal(expected, actual); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
using TextCase.Converters; | ||
using TextCase.Extensions; | ||
using Xunit; | ||
|
||
namespace TextCase.UnitTests | ||
{ | ||
public class ConstantCaseConverterTest | ||
{ | ||
[Theory] | ||
[InlineData("hello world", "HELLO_WORLD")] | ||
[InlineData("icH bIn glückLICH", "ICH_BIN_GLÜCKLICH")] | ||
[InlineData("indent_style = space, 2-\nindent_size = 2", "INDENT_STYLE_SPACE_2\nINDENT_SIZE_2")] | ||
[InlineData("Hello World!", "HELLO_WORLD")] | ||
[InlineData("123 test", "123_TEST")] | ||
[InlineData("test with multiple spaces", "TEST_WITH_MULTIPLE_SPACES")] | ||
[InlineData("test_with_underscore", "TEST_WITH_UNDERSCORE")] | ||
[InlineData("test-with-dash", "TEST_WITH_DASH")] | ||
[InlineData("test.with.period", "TEST_WITH_PERIOD")] | ||
[InlineData("test/with/slash", "TEST_WITH_SLASH")] | ||
[InlineData("test\\with\\backslash", "TEST_WITH_BACKSLASH")] | ||
public void Convert_WhenConstantCase_TextShouldBeConstantCase(string input, string expected) | ||
{ | ||
// Setup | ||
var service = new ConstantCaseConverter(); | ||
|
||
// Execute | ||
var actual = service.Convert(input); | ||
|
||
// Assert | ||
Assert.Equal(expected, actual); | ||
} | ||
|
||
[Theory] | ||
[InlineData("hello world", "HELLO_WORLD")] | ||
[InlineData("icH bIn glückLICH", "ICH_BIN_GLÜCKLICH")] | ||
[InlineData("indent_style = space, 2-\nindent_size = 2", "INDENT_STYLE_SPACE_2\nINDENT_SIZE_2")] | ||
[InlineData("Hello World!", "HELLO_WORLD")] | ||
[InlineData("123 test", "123_TEST")] | ||
[InlineData("test with multiple spaces", "TEST_WITH_MULTIPLE_SPACES")] | ||
[InlineData("test_with_underscore", "TEST_WITH_UNDERSCORE")] | ||
[InlineData("test-with-dash", "TEST_WITH_DASH")] | ||
[InlineData("test.with.period", "TEST_WITH_PERIOD")] | ||
[InlineData("test/with/slash", "TEST_WITH_SLASH")] | ||
[InlineData("test\\with\\backslash", "TEST_WITH_BACKSLASH")] | ||
public void ToConstantCase_WhenConstantCase_TextShouldBeConstantCase(string input, string output) | ||
{ | ||
// Execute | ||
var convertedText = input.ToConstantCase(); | ||
|
||
// Assert | ||
var expected = output; | ||
var actual = convertedText; | ||
Assert.Equal(expected, actual); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
using System; | ||
using TextCase.Converters; | ||
using TextCase.Extensions; | ||
using Xunit; | ||
|
||
namespace TextCase.UnitTests | ||
{ | ||
public class InverseCaseConverterTest | ||
{ | ||
[Theory] | ||
[InlineData("hello world", "hElLo WoRlD")] | ||
[InlineData("icH bIn glückLICH", "iCh BiN gLüCkLiCh")] | ||
[InlineData(" che ore sono? ", " cHe OrE sOnO? ")] | ||
public void Convert_WhenCamelCase_TextShouldBeCamelCase(string input, string output) | ||
{ | ||
// Setup | ||
var service = new InverseCaseConverter(); | ||
|
||
// Execute | ||
var convertedText = service.Convert(input); | ||
|
||
// Assert | ||
var expected = output; | ||
var actual = convertedText; | ||
Assert.Equal(expected, actual); | ||
} | ||
|
||
[Theory] | ||
[InlineData("hello world", "hElLo WoRlD")] | ||
[InlineData("icH bIn glückLICH", "iCh BiN gLüCkLiCh")] | ||
[InlineData(" che ore sono? ", " cHe OrE sOnO? ")] | ||
[InlineData("You talking to me?", "yOu TaLkInG tO mE?")] | ||
public void ToInverseCase_WhenCamelCase_TextShouldBeCamelCase(string input, string output) | ||
{ | ||
// Execute | ||
var convertedText = input.ToInverseCase(); | ||
|
||
// Assert | ||
var expected = output; | ||
var actual = convertedText; | ||
Assert.Equal(expected, actual); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,21 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>net8.0</TargetFramework> | ||
|
||
<IsPackable>false</IsPackable> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.3.1" /> | ||
<PackageReference Include="xunit" Version="2.4.2" /> | ||
<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> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\TextCase\TextCase.csproj" /> | ||
</ItemGroup> | ||
|
||
</Project> | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
<PropertyGroup> | ||
<TargetFramework>net8.0</TargetFramework> | ||
<IsPackable>false</IsPackable> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.3.1" /> | ||
<PackageReference Include="xunit" Version="2.4.2" /> | ||
<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> | ||
<ItemGroup> | ||
<ProjectReference Include="..\TextCase\TextCase.csproj" /> | ||
</ItemGroup> | ||
</Project> |
Oops, something went wrong.