27 lines
730 B
C#
27 lines
730 B
C#
namespace Tests.Recursion;
|
|
|
|
public class RecursionTest
|
|
{
|
|
[Theory]
|
|
[InlineData("abcdef132", 0, true)]
|
|
[InlineData("!abcdef", 0, false)]
|
|
[InlineData("!abcdef", 1, true)]
|
|
[InlineData("abcdef!", 15, true)]
|
|
|
|
public void IsAlphanumTest(string s, int i, bool expected)
|
|
{
|
|
bool actual = Iteration.Recursion.IsAlphanum(s, i);
|
|
Assert.Equal(expected, actual);
|
|
}
|
|
|
|
[Theory]
|
|
[InlineData("42", 2, "24")]
|
|
[InlineData("123", 3, "321")]
|
|
[InlineData("ABcdeF",6, "FedcBA")]
|
|
|
|
public void ReverseStrTest(string source, int lenght, string expected)
|
|
{
|
|
string actual = Iteration.Recursion.ReverseStr(source, lenght);
|
|
Assert.Equal(expected, actual);
|
|
}
|
|
} |