diff options
author | Microsoft <aspnet@microsoft.com> | 2011-12-20 17:52:24 -0800 |
---|---|---|
committer | Andrew Arnott <andrewarnott@gmail.com> | 2012-03-01 19:36:32 -0800 |
commit | 1197a5c95f0af0ced8339ae07ef6b3980532c8d7 (patch) | |
tree | b771327d73f970665e28c9679b2baf6c2e0a9b67 /src/DotNetOpenAuth.AspNet.Test/UriHelperTest.cs | |
parent | 67e1a42ffe2ed7ac2bf99c703f17e4406cc35921 (diff) | |
download | DotNetOpenAuth-1197a5c95f0af0ced8339ae07ef6b3980532c8d7.zip DotNetOpenAuth-1197a5c95f0af0ced8339ae07ef6b3980532c8d7.tar.gz DotNetOpenAuth-1197a5c95f0af0ced8339ae07ef6b3980532c8d7.tar.bz2 |
Make changes per discussion. Remove the DNOA.WebPages project. Rename DNOA.Web to DNOA.AspNet.
Diffstat (limited to 'src/DotNetOpenAuth.AspNet.Test/UriHelperTest.cs')
-rw-r--r-- | src/DotNetOpenAuth.AspNet.Test/UriHelperTest.cs | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/src/DotNetOpenAuth.AspNet.Test/UriHelperTest.cs b/src/DotNetOpenAuth.AspNet.Test/UriHelperTest.cs new file mode 100644 index 0000000..53a2b52 --- /dev/null +++ b/src/DotNetOpenAuth.AspNet.Test/UriHelperTest.cs @@ -0,0 +1,41 @@ +using System; +using DotNetOpenAuth.AspNet.Clients; +using NUnit.Framework; + +namespace DotNetOpenAuth.AspNet.Test +{ + [TestFixture] + public class UriHelperTest + { + [TestCase] + public void TestAttachQueryStringParameterMethod() + { + // Arrange + string[] input = new string[] + { + "http://x.com", + "https://xxx.com/one?s=123", + "https://yyy.com/?s=6&u=a", + "https://zzz.com/default.aspx?name=sd" + }; + + string[] expectedOutput = new string[] + { + "http://x.com/?s=awesome", + "https://xxx.com/one?s=awesome", + "https://yyy.com/?s=awesome&u=a", + "https://zzz.com/default.aspx?name=sd&s=awesome" + }; + + for (int i = 0; i < input.Length; i++) + { + // Act + var inputUrl = new Uri(input[i]); + var outputUri = UriHelper.AttachQueryStringParameter(inputUrl, "s", "awesome"); + + // Assert + Assert.AreEqual(expectedOutput[i], outputUri.ToString()); + } + } + } +} |