public void Can_set_values_with_default_indexer() { var session = new FakeHttpSessionState(); session["name"] = "slim"; Assert.That(session["name"], Is.EqualTo("slim")); }
public void Can_set_values_with_default_indexer() { var session = new FakeHttpSessionState(); session["name"] = "slim"; Assert.That(session["name"], Is.EqualTo("slim")); }
public void Should_add_values_to_session() { var session = new FakeHttpSessionState { { "color", "red" } }; Assert.That(session["color"], Is.EqualTo("red")); }
public void Can_initialize_context_with_existing_session() { var session = new FakeHttpSessionState(); var context = new FakeHttpContext(session: session); Assert.That(context.Session, Is.SameAs(session)); }
public void SetUp() { _expectedItem = DateTime.Now; _session = new FakeHttpSessionState(); _session[ExpectedSessionKey] = _expectedItem; _session["anotherSessionItem"] = Guid.NewGuid(); _session["yetAnotherSessionItem"] = Guid.NewGuid(); }
public void Can_initialize_context_with_existing_session() { var session = new FakeHttpSessionState(); var context = new FakeHttpContext(session: session); Assert.That(context.Session, Is.SameAs(session)); }
internal static IDictionary <string, object> ToDictionary( this FakeHttpSessionState state ) { return(state.Keys.AsEnumerable().Aggregate(new List <KeyValuePair <string, object> >(), (acc, cur) => { acc.Add(new KeyValuePair <string, object>(cur, state[cur])); return acc; }).ToDictionary(kvp => kvp.Key, kvp => kvp.Value)); }
private void InitializeSession() { System.Web.HttpContext.Current = new System.Web.HttpContext(workerRequest); System.Web.HttpContext.Current.Items.Clear(); var fakeHttpSessionState = new FakeHttpSessionState(); System.Web.SessionState.HttpSessionState session = (System.Web.SessionState.HttpSessionState)ReflectionHelper.Instantiate(typeof(System.Web.SessionState.HttpSessionState), new Type[] { typeof(IHttpSessionState) }, fakeHttpSessionState); Context = new HttpContext(new BaseWrapped.SimulatedHttpRequest(workerRequest), new HttpSessionState(fakeHttpSessionState), new BaseWrapped.HttpServerUtility(new ConfigMapPath(this))); System.Web.HttpContext.Current.Items.Add("AspSession", session); }
public void SetUp() { var collection = new FakeHttpSessionState(); _session = collection; }
public void SetUp() { _session = new FakeHttpSessionState(); }
public ExceptionWithDataBuilderTests() { _mockRequest = new Mock <HttpRequestWrapper>(new HttpRequest("", "http://localhost", "")); _mockSessionState = FakeHttpSessionState.Build(); _exception = new Exception(); }
public void Should_add_values_to_session() { var session = new FakeHttpSessionState { { "color", "red" } }; Assert.That(session["color"], Is.EqualTo("red")); }