38 lines
1.0 KiB
C#
38 lines
1.0 KiB
C#
namespace Tests.Interatif;
|
|
|
|
public class IterationTests
|
|
{
|
|
[Theory]
|
|
[InlineData(123, 321)]
|
|
[InlineData(1234, 4321)]
|
|
[InlineData(4, 4)]
|
|
[InlineData(-4, -4)]
|
|
[InlineData(24, 42)]
|
|
[InlineData(-123456, -654321)]
|
|
|
|
public void ReverseintTest(int n, int expected)
|
|
{
|
|
int actual = Iteration.Iterations.Reverseint(n);
|
|
Assert.Equal(expected, actual);
|
|
}
|
|
|
|
[Theory]
|
|
[InlineData("Clement est le plus beau", "moche", false)]
|
|
[InlineData("Clement est le plus beau", "beau", true)]
|
|
|
|
public void FindSubTest(string s, string sub, bool expected)
|
|
{
|
|
bool actual = Iteration.Iterations.FindSub(s, sub);
|
|
Assert.Equal(expected, actual);
|
|
}
|
|
|
|
[Theory]
|
|
[InlineData("Je me crois en enfer, donc j'y suis.", "Je Me Crois En Enfer, Donc J'y Suis.")]
|
|
[InlineData("!abc !def ghi .klm", "!abc !def Ghi .klm")]
|
|
|
|
public void CapitalizeTest(string s, string expected)
|
|
{
|
|
string actual = Iteration.Iterations.FirstUpper(s);
|
|
Assert.Equal(expected, actual);
|
|
}
|
|
} |