I have the following method, which I want to perform a unit test on. Change can be made for the method signature:
public void PrintNumber()
{
Enumerable.Range(1, 100).ToList().ForEach(x =>
{
if (x % 3 == 0 && x % 5 == 0)
Console.WriteLine("[35]");
else if (x % 3 == 0)
Console.WriteLine("[3]");
else if (x % 5 == 0)
Console.WriteLine("[5]");
else
Console.WriteLine(x.ToString());
});
}
I have my own solution, but I want to find out if my version is the best.
Thanks!