Beispiel #1
0
        public void JavaScriptStringEncodeReturnsNullIfMessageIsNull()
        {
            // Act
            string encoded = AjaxExtensions.JavaScriptStringEncode(null /* helper */, null /* message */);

            // Assert
            Assert.IsNull(encoded);
        }
Beispiel #2
0
        public void JavaScriptStringEncodeReturnsEmptyStringIfMessageIsEmpty()
        {
            // Act
            string encoded = AjaxExtensions.JavaScriptStringEncode(null /* helper */, String.Empty);

            // Assert
            Assert.AreEqual(String.Empty, encoded);
        }
Beispiel #3
0
        public void JavaScriptStringEncodeReturnsEncodedMessage()
        {
            // Arrange
            string message = "I said, \"Hello, world!\"\nHow are you?";

            // Act
            string encoded = AjaxExtensions.JavaScriptStringEncode(null /* helper */, message);

            // Assert
            Assert.AreEqual(@"I said, \""Hello, world!\""\nHow are you?", encoded);
        }