public void TestCookieExists() { //SETUP var mocks = new MockHttpContextCookies(); var eProvider = new EphemeralDataProtectionProvider(); var cookie = new ImpersonationCookie(mocks.MockContext, eProvider); cookie.AddUpdateCookie("Hello world"); mocks.RequestCookies["UserImpersonation"] = "???"; //ATTEMPT //VERIFY cookie.Exists(mocks.MockContext.Request.Cookies).ShouldBeTrue(); }
public void TestCookieExists() { //SETUP var httpContext = new DefaultHttpContext(); var eProvider = new EphemeralDataProtectionProvider(); var cookie = new ImpersonationCookie(httpContext, eProvider); cookie.AddUpdateCookie("Hello world"); httpContext.AddRequestCookie("UserImpersonation", "???"); //ATTEMPT //VERIFY cookie.Exists(httpContext.Request.Cookies).ShouldBeTrue(); }