Exemple #1
0
 static void Main(string[] args)
 {
     Console.WriteLine("...::: Agile Content Challenge :::...\r\n");
     Console.WriteLine("* 1 - DecReprSenior:\r\n");
     Console.WriteLine("- N Simblings for {0} are {1}", 535, NSimblingsSolution.Solution(535));
     Console.WriteLine("- N Simblings for {0} are {1}", 123, NSimblingsSolution.Solution(123));
     Console.WriteLine("- N Simblings for {0} are {1}", int.MaxValue, NSimblingsSolution.Solution(int.MaxValue));
     Console.WriteLine("- N Simblings for {0} are {1}", 100000000, NSimblingsSolution.Solution(100000000));
     Console.WriteLine("- N Simblings for {0} are {1}", 392, NSimblingsSolution.Solution(392));
     Console.WriteLine("- N Simblings for {0} are {1}\r\n", 213, NSimblingsSolution.Solution(213));
     Console.WriteLine("Pressione qualquer tecla para sair...");
     Console.ReadKey();
 }
Exemple #2
0
            public void Given_ValidInteger_ExpectCorrectSimbling()
            {
                IList <IntegerSimblingTest> simblingKeyValueList = new List <IntegerSimblingTest>()
                {
                    new IntegerSimblingTest(0, 0),
                    new IntegerSimblingTest(535, 553),
                    new IntegerSimblingTest(123, 321),
                    new IntegerSimblingTest(392, 932),
                    new IntegerSimblingTest(10000000, 10000000)
                };

                foreach (var simblingKeyValue in simblingKeyValueList)
                {
                    int solution = NSimblingsSolution.Solution(simblingKeyValue.N);
                    solution.Should().Be(simblingKeyValue.Simbling);
                }
            }
Exemple #3
0
            public void When_IntegerIsGreaterThanOneHundredMillion_ExpectMinusOne(int n)
            {
                int solution = NSimblingsSolution.Solution(n);

                solution.Should().Be(-1);
            }
Exemple #4
0
            public void When_IntegerIsLessThanZero_ExpectArgumentOutOfRangeException(int n)
            {
                Action solutionMethod = () => NSimblingsSolution.Solution(n);

                solutionMethod.Should().Throw <ArgumentOutOfRangeException>();
            }