<?xml version="1.0"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Jason Bock's Weblog - Recent Comments for "Adding Session State to a Mock HttpContext Object"</title>
    <link>http://www.jasonbock.net/JB/Default.aspx?blog=entry.161daabc728842aca6f329d87c81cfcb</link>
    <description>Adding Session State to a Mock HttpContext Object</description>
    <managingEditor>jason@jasonbock.net</managingEditor>
    <dc:language>en</dc:language>
    <item>
      <dc:creator>Jason Bock</dc:creator>
      <title>Oops - Code Link</title>
      <link>http://www.jasonbock.net/JB/Default.aspx?blog=entry.161daabc728842aca6f329d87c81cfcb#7eb919bdbc0f4a24a84adda9909ea14e</link>
      <pubDate>Wed, 07 Sep 2005 13:10:08 GMT</pubDate>
      <guid isPermaLink="false">7eb919bdbc0f4a24a84adda9909ea14e</guid>
      <description>For some reason I forgot to add the code link. I'll update the post later but for now you can get it here:&lt;br/&gt;&lt;br/&gt;http://www.jasonbock.net/JB/Code/MockHttpContext.zip</description>
    </item>
    <item>
      <dc:creator>mike h</dc:creator>
      <title>very cool</title>
      <link>http://www.jasonbock.net/JB/Default.aspx?blog=entry.161daabc728842aca6f329d87c81cfcb#1994cfaa42da4d2a828ad76f318a3d59</link>
      <pubDate>Wed, 07 Sep 2005 14:22:33 GMT</pubDate>
      <guid isPermaLink="false">1994cfaa42da4d2a828ad76f318a3d59</guid>
      <description>Excellent.  Very cool.  </description>
    </item>
    <item>
      <dc:creator>Mike B</dc:creator>
      <title>Senior Developer</title>
      <link>http://www.jasonbock.net/JB/Default.aspx?blog=entry.161daabc728842aca6f329d87c81cfcb#34311ec2d606459d928b62424a2a16dd</link>
      <pubDate>Fri, 14 Jul 2006 18:16:12 GMT</pubDate>
      <guid isPermaLink="false">34311ec2d606459d928b62424a2a16dd</guid>
      <description>I'm getting &amp;quot;The following add-in(s) falied to load&amp;quot; message with the FileGenerator built with the download from this page. I have the latest Reflector version reference (4.2.0.0) as you specified. Any chance there is a newer version of FileGenerator? &lt;br/&gt;&lt;br/&gt;Sorry, forgot to mention building with VS 2005 on .Net 2.0 </description>
    </item>
    <item>
      <dc:creator>Brendan Tompkins</dc:creator>
      <title>Thanks!</title>
      <link>http://www.jasonbock.net/JB/Default.aspx?blog=entry.161daabc728842aca6f329d87c81cfcb#52f524dc785f4cd1984593aece422544</link>
      <pubDate>Mon, 06 Aug 2007 15:15:15 GMT</pubDate>
      <guid isPermaLink="false">52f524dc785f4cd1984593aece422544</guid>
      <description>Thanks Jason,&lt;br/&gt;&lt;br/&gt;I've recently found myself in the unfortunate position to do this, and your code worked like a charm!&lt;br/&gt;</description>
    </item>
    <item>
      <dc:creator>si</dc:creator>
      <title>Thank you!</title>
      <link>http://www.jasonbock.net/JB/Default.aspx?blog=entry.161daabc728842aca6f329d87c81cfcb#b128efe04f1a493582e7dad221e1d31a</link>
      <pubDate>Tue, 09 Oct 2007 03:16:13 GMT</pubDate>
      <guid isPermaLink="false">b128efe04f1a493582e7dad221e1d31a</guid>
      <description>Another thank you from a grateful developer! :)</description>
    </item>
    <item>
      <dc:creator>Ivan</dc:creator>
      <title>dr.</title>
      <link>http://www.jasonbock.net/JB/Default.aspx?blog=entry.161daabc728842aca6f329d87c81cfcb#4a3f580e6dc4442ea91ced81a64460ec</link>
      <pubDate>Sat, 03 Nov 2007 18:31:01 GMT</pubDate>
      <guid isPermaLink="false">4a3f580e6dc4442ea91ced81a64460ec</guid>
      <description>Thank you for your post! It helped me so much!</description>
    </item>
    <item>
      <dc:creator>Woric</dc:creator>
      <title>Fantastic Work</title>
      <link>http://www.jasonbock.net/JB/Default.aspx?blog=entry.161daabc728842aca6f329d87c81cfcb#875604a9830d4ee0bca985f1b18221a9</link>
      <pubDate>Fri, 14 Dec 2007 23:57:26 GMT</pubDate>
      <guid isPermaLink="false">875604a9830d4ee0bca985f1b18221a9</guid>
      <description>Thanks Jason - you've solved a problem I've been struggling with for ages. Excellent work.</description>
    </item>
    <item>
      <dc:creator>Bob MacNeal</dc:creator>
      <title>Small World</title>
      <link>http://www.jasonbock.net/JB/Default.aspx?blog=entry.161daabc728842aca6f329d87c81cfcb#9c6904ccc9ed4af9ad05ff764d2bda76</link>
      <pubDate>Thu, 14 Feb 2008 19:05:58 GMT</pubDate>
      <guid isPermaLink="false">9c6904ccc9ed4af9ad05ff764d2bda76</guid>
      <description>Jason,&lt;br/&gt;Thanks. Your code was to the solution to NUnit problems I was having and corresponding poor test coverage.  After I implemented your solution, I discovered my buddy and Scrum-mate, known in some circles as Super Dave, knows you from Best Buy days. Small world.&lt;br/&gt;Cheers,&lt;br/&gt;Bob.</description>
    </item>
    <item>
      <dc:creator>Kevin Hakanson</dc:creator>
      <title>typo</title>
      <link>http://www.jasonbock.net/JB/Default.aspx?blog=entry.161daabc728842aca6f329d87c81cfcb#e5b310334b324589b28eb778153c6151</link>
      <pubDate>Thu, 20 Mar 2008 16:49:44 GMT</pubDate>
      <guid isPermaLink="false">e5b310334b324589b28eb778153c6151</guid>
      <description>Nice article, but it looks like a small typo in the text (but not the code sample) - an extra y after Activator:  Activatory.CreateInstance()&lt;br/&gt;&lt;br/&gt;Maybe I will see you at the next Twin Cities Code Camp (if I can make it).</description>
    </item>
    <item>
      <dc:creator>Jason Bock</dc:creator>
      <title>Activatory is now Activator</title>
      <link>http://www.jasonbock.net/JB/Default.aspx?blog=entry.161daabc728842aca6f329d87c81cfcb#c6111abf838846d1ad0b3af1a1e5cb56</link>
      <pubDate>Thu, 20 Mar 2008 16:57:43 GMT</pubDate>
      <guid isPermaLink="false">c6111abf838846d1ad0b3af1a1e5cb56</guid>
      <description>Thanks for the catch</description>
    </item>
    <item>
      <dc:creator>Vaibhav</dc:creator>
      <title>Does not work :((</title>
      <link>http://www.jasonbock.net/JB/Default.aspx?blog=entry.161daabc728842aca6f329d87c81cfcb#0adb1e87ddf94fc0af6c7fb730a30323</link>
      <pubDate>Thu, 10 Apr 2008 05:15:24 GMT</pubDate>
      <guid isPermaLink="false">0adb1e87ddf94fc0af6c7fb730a30323</guid>
      <description>Hi,&lt;br/&gt;HttpContext context = (new MockHttpContext(false)).Context;&lt;br/&gt;this works &lt;br/&gt;but this fails&lt;br/&gt;System.Web.HttpContext.Current.Session[&amp;quot;UserName&amp;quot;] =  &amp;quot;V.jain&amp;quot;;&lt;br/&gt;&lt;br/&gt;Any idea how I could accomplish it?&lt;br/&gt;</description>
    </item>
    <item>
      <dc:creator>Benjy</dc:creator>
      <title>Great stuff</title>
      <link>http://www.jasonbock.net/JB/Default.aspx?blog=entry.161daabc728842aca6f329d87c81cfcb#e4ce0430e386473aae0793c899d68f89</link>
      <pubDate>Mon, 04 Aug 2008 22:00:42 GMT</pubDate>
      <guid isPermaLink="false">e4ce0430e386473aae0793c899d68f89</guid>
      <description>Jason, thanks for this. It works superbly. Have referred to this here&lt;br/&gt;http://santoshbenjamin.wordpress.com/2008/08/04/mock-httpcontext-and-session-state/&lt;br/&gt;&lt;br/&gt;Thanks&lt;br/&gt;Benjy&lt;br/&gt;&lt;br/&gt;PS: Vaibhav, after creating the context, just use context.Session.Add() and context.Session[&amp;quot;xyz]  etc...</description>
    </item>
    <item>
      <dc:creator>Daniel Elliott</dc:creator>
      <title>Wonderful example</title>
      <link>http://www.jasonbock.net/JB/Default.aspx?blog=entry.161daabc728842aca6f329d87c81cfcb#91415861d95d4193bbd11e7ad2cfbb58</link>
      <pubDate>Tue, 09 Sep 2008 19:57:25 GMT</pubDate>
      <guid isPermaLink="false">91415861d95d4193bbd11e7ad2cfbb58</guid>
      <description>I was sold after adding this unit test (The cache was my key concern.)&lt;br/&gt;&lt;br/&gt; [TestMethod]&lt;br/&gt;        public void UseCache()&lt;br/&gt;        {&lt;br/&gt;            HttpContext context = (new MockHttpContext(false)).Context;&lt;br/&gt;            context.Cache.Add(&amp;quot;test&amp;quot;, &amp;quot;test value&amp;quot;, null, DateTime.Now.AddMinutes(1), TimeSpan.Zero, CacheItemPriority.Normal, null);&lt;br/&gt;            Assert.AreEqual(context.Cache.Get(&amp;quot;test&amp;quot;).ToString(), &amp;quot;test value&amp;quot;);&lt;br/&gt;            Assert.AreEqual(HttpContext.Current.Cache.Get(&amp;quot;test&amp;quot;).ToString(), &amp;quot;test value&amp;quot;);&lt;br/&gt;        }&lt;br/&gt;</description>
    </item>
    <item>
      <dc:creator>Anthony Main</dc:creator>
      <title>Creating an ApplicationState</title>
      <link>http://www.jasonbock.net/JB/Default.aspx?blog=entry.161daabc728842aca6f329d87c81cfcb#099ad2d255834a5d915fd3147062c66f</link>
      <pubDate>Wed, 08 Apr 2009 14:27:59 GMT</pubDate>
      <guid isPermaLink="false">099ad2d255834a5d915fd3147062c66f</guid>
      <description>I've been using your MockhttpContext in a few projects as a test base, its awesome good effort!&lt;br/&gt;&lt;br/&gt;But in my current application Im trying to test teh Application Context instead of just the session. I've been digging through the reflector classes but can't find how to set the application state the way you set the session state.&lt;br/&gt;&lt;br/&gt;Any pointers would be great</description>
    </item>
    <item>
      <dc:creator>Tyres Dealer</dc:creator>
      <title>Tyres Dealer</title>
      <link>http://www.jasonbock.net/JB/Default.aspx?blog=entry.161daabc728842aca6f329d87c81cfcb#12cbfabe8b3148b0938832a71199feaf</link>
      <pubDate>Fri, 13 Nov 2009 07:01:42 GMT</pubDate>
      <guid isPermaLink="false">12cbfabe8b3148b0938832a71199feaf</guid>
      <description>That's great, I never thought about Adding Session State to a Mock like that before.&lt;br/&gt;</description>
    </item>
  </channel>
</rss>