コード例 #1
0
        public void ReverseString_StringIsApplesTwoSpaces_ShouldReturn_selppAWithTwoSpaces()
        {
            // Arrange
            StringExamples stringExamples = new StringExamples();

            // Act
            var reverseString = stringExamples.ReverseString("A pple s");

            // Assert
            Assert.AreEqual("s elpp A", reverseString);
        }
コード例 #2
0
        public void ReverseString_StringIsHelloWithSpace_ShouldReturn_olleHWithSpace()
        {
            // Arrange
            StringExamples stringExamples = new StringExamples();

            // Act
            var reverseString = stringExamples.ReverseString("He llo");

            // Assert
            Assert.AreEqual("oll eH", reverseString);
        }
コード例 #3
0
        public void ReverseString_StringIsApplesTwoSpacesWithDifferentOppositePositions_ShouldReturn_selppAWithReverseOfTwoSpaces()
        {
            // Arrange
            StringExamples stringExamples = new StringExamples();

            // Act
            var reverseString = stringExamples.ReverseString("A pp les");

            // Assert
            Assert.AreEqual("sel pp A", reverseString);
        }
コード例 #4
0
        public void ReverseString_StringIsHeplo_ShouldReturn_olpeH()
        {
            // Arrange
            StringExamples stringExamples = new StringExamples();

            // Act
            var reverseString = stringExamples.ReverseString("Heplo");

            // Assert
            Assert.AreEqual("olpeH", reverseString);
        }
コード例 #5
0
        public void ReverseString_StringIsEmpty_ShouldThrowInvalidOperationException()
        {
            // Arrange
            StringExamples stringExamples = new StringExamples();

            // Act
            Action reverseStringFunc = () => stringExamples.ReverseString("");

            // Assert
            Assert.ThrowsException <InvalidOperationException>(reverseStringFunc);
        }