public void SetRedirectUrlToCurrentPage_NormalUrl_Set() { // Assign _headerDictionary.Setup(x => x.AppendValues(It.IsAny <string>(), It.IsAny <string>())).Callback <string, string[]>((key, values) => { Assert.AreEqual("Set-Cookie", key); Assert.IsTrue(values[0].Contains(Redirector.RedirectUrlCookieFieldName + "=" + Uri.EscapeDataString("http://localhost/mywebsite/myaction?=foo"))); }); // Act _redirector.SetRedirectUrlToCurrentPage(); }
public void SetRedirectUrlToCurrentPage_NormalUrl_Set() { // Assign _responseCookies.Setup(x => x.Append(It.IsAny <string>(), It.IsAny <string>())).Callback <string, string>((key, value) => { Assert.AreEqual(Redirector.RedirectUrlCookieFieldName, key); Assert.AreEqual("http://localhost/mywebsite/myaction%3F=foo", value); }); // Act _redirector.SetRedirectUrlToCurrentPage(); }