30 lines
874 B
C#
30 lines
874 B
C#
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
|
|
|
namespace VAR.HttpServer.Tests
|
|
{
|
|
[TestClass()]
|
|
public class HttpUtilityTests
|
|
{
|
|
[TestMethod()]
|
|
public void UrlEncode__UrlDecode__TestWithAsciiSymbols()
|
|
{
|
|
string strOrigin = "Hello World! $%&//();@!";
|
|
|
|
string strEncoded = HttpUtility.UrlEncode(strOrigin);
|
|
string strDecoded = HttpUtility.UrlDecode(strEncoded);
|
|
|
|
Assert.AreEqual(strOrigin, strDecoded);
|
|
}
|
|
|
|
[TestMethod()]
|
|
public void UrlEncode__UrlDecode__TestWithLocalSymbols()
|
|
{
|
|
string strOrigin = "Hello World! ¿?¡! ñÑ áéíóú ";
|
|
|
|
string strEncoded = HttpUtility.UrlEncode(strOrigin);
|
|
string strDecoded = HttpUtility.UrlDecode(strEncoded);
|
|
|
|
Assert.AreEqual(strOrigin, strDecoded);
|
|
}
|
|
}
|
|
} |