Esempio n. 1
0
        public void Convert_1_Row()
        {
            var input = "PAYPALISHIRING";

            var result = ZigZagConversion.Convert(input, 1);

            Assert.AreEqual("PAYPALISHIRING", result);
        }
Esempio n. 2
0
        public void Convert_4_Row()
        {
            var input = "PAYPALISHIRING";

            var result = ZigZagConversion.Convert(input, 4);

            Assert.AreEqual("PINAASRGYHPLII", result);
        }
Esempio n. 3
0
        public void Convert_3_Row()
        {
            var input = "PAYPALISHIRING";

            var result = ZigZagConversion.Convert(input, 3);

            Assert.AreEqual("PAHNAPLSIIGYIR", result);
        }
Esempio n. 4
0
        public void Convert_2_Row()
        {
            var input = "PAYPALISHIRING";

            var result = ZigZagConversion.Convert(input, 2);

            Assert.AreEqual("PPIINAYALSHRIG", result);
        }
Esempio n. 5
0
        public void Test(string input, int rowNumber, string expected)
        {
            var actul = new ZigZagConversion();

            var rslt = actul.Convert(input, rowNumber);

            Assert.Equal(expected, rslt);
        }
Esempio n. 6
0
        public void Convert_ShouldConvert_StringToZigZag(
            string input,
            int numberOfRows,
            string expectedOutput)
        {
            // Arrange
            var converter = new ZigZagConversion();

            // Act
            var output = converter.Convert(input, numberOfRows);

            // Assert
            output.Should().Be(expectedOutput);
        }
Esempio n. 7
0
        public void Test_Convert(string inputStr, int inputNo, string output)
        {
            var actual = _objUnderTest.Convert(inputStr, inputNo);

            Assert.Equal(output, actual);
        }