Exemplo n.º 1
0
        public void SortTest_GivenTestCases(string pancakeString, int expectedResult)
        {
            // While loop
            var(gotPancakeString, attemptsResult) = _pancakeSorter.Sort(pancakeString);
            gotPancakeString.Should().NotBeNullOrEmpty();
            gotPancakeString.Should().NotContain("-");
            gotPancakeString.Length.Should().Be(pancakeString.Length);
            attemptsResult.Should().Be(expectedResult);

            // Recursive
            (gotPancakeString, attemptsResult) = _pancakeSorter.SortRecursive(pancakeString);
            gotPancakeString.Should().NotBeNullOrEmpty();
            gotPancakeString.Should().NotContain("-");
            gotPancakeString.Length.Should().Be(pancakeString.Length);
            attemptsResult.Should().Be(expectedResult);
        }