/// <summary>
/// Mock implementation of HttpSessionStateBase
/// </summary>
/// <remarks>
/// Current stable build of Moq (2.6.1014.1) doesn't support property indexers
/// at this time, so this is an implementation of HttpSessionStateBase
/// which allows us to verify that the session cache is being updated.
/// </remarks>
internal class MockSession : HttpSessionStateBase
{ Dictionary<string, object> session = new Dictionary<string, object>();
public override void Add(string name, object value)
{ session.Add(name, value);
}
public override object this[string name]
{ get
{ if (!session.ContainsKey(name))
return null;
return session[name];
}
set
{ session[name] = value;
}
}
}