Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 0 additions & 12 deletions exercises/practice/rest-api/.meta/Generator.tpl

This file was deleted.

2 changes: 1 addition & 1 deletion exercises/practice/say/SayTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ public void Numbers_below_zero_are_out_of_range()
}

[Fact(Skip = "Remove this Skip property to run this test")]
public void Numbers_above_999999999999_are_out_of_range()
public void Numbers_above_999_999_999_999_are_out_of_range()
{
Assert.Throws<ArgumentOutOfRangeException>(() => Say.InEnglish(1000000000000L));
}
Expand Down
4 changes: 2 additions & 2 deletions exercises/practice/simple-cipher/SimpleCipherTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public void Random_key_cipher_can_decode()
}

[Fact(Skip = "Remove this Skip property to run this test")]
public void Random_key_cipher_is_reversible_ie_if_you_apply_decode_in_a_encoded_result_you_must_see_the_same_plaintext_encode_parameter_as_a_result_of_the_decode_method()
public void Random_key_cipher_is_reversible_i_e_if_you_apply_decode_in_a_encoded_result_you_must_see_the_same_plaintext_encode_parameter_as_a_result_of_the_decode_method()
{
var sut = new SimpleCipher();
Assert.Equal("abcdefghij", sut.Decode(sut.Encode("abcdefghij")));
Expand Down Expand Up @@ -45,7 +45,7 @@ public void Substitution_cipher_can_decode()
}

[Fact(Skip = "Remove this Skip property to run this test")]
public void Substitution_cipher_is_reversible_ie_if_you_apply_decode_in_a_encoded_result_you_must_see_the_same_plaintext_encode_parameter_as_a_result_of_the_decode_method()
public void Substitution_cipher_is_reversible_i_e_if_you_apply_decode_in_a_encoded_result_you_must_see_the_same_plaintext_encode_parameter_as_a_result_of_the_decode_method()
{
var sut = new SimpleCipher("abcdefghij");
Assert.Equal("abcdefghij", sut.Decode(sut.Encode("abcdefghij")));
Expand Down
6 changes: 5 additions & 1 deletion generators/Naming.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using System.Text.RegularExpressions;
using Humanizer;

namespace Generators;
Expand All @@ -19,7 +20,10 @@ private static string Transform(string str, int index) =>
index == 0 && int.TryParse(str, out var i)
? i.ToWords()
: str.Dehumanize();

private static IEnumerable<string> Words(this string str) =>
Regex.Split(str, @"\W+")
.Where(s => !string.IsNullOrWhiteSpace(s));

private static string[] Words(this string str) => str.Split(' ', '-');
private static string Unwords(this IEnumerable<string> strs) => string.Join(' ', strs);
}
Loading