title: Unit testing rendering context. Page context throws an exception
body: <p>I am trying to create unit test using sitecoreFakeDB my code displays below:</p>
  
  <pre><code>using (Sitecore.FakeDb.Db db = new Sitecore.FakeDb.Db() { new Sitecore.FakeDb.DbItem("source") })
          {
              var contextItem = db.GetItem("/sitecore/content/source");
              var args = new Sitecore.Pipelines.PipelineArgs();
              using (RenderingContext.EnterContext(new Rendering(), contextItem))
              {
  
                  var processor = new Mock&lt;Sitecore.FakeDb.Pipelines.IPipelineProcessor&gt;();
  
                  db.PipelineWatcher.Register("mypipeline", processor.Object);
  
                  Sitecore.Pipelines.CorePipeline.Run("mypipeline", args);
  
                  Xunit.Assert.NotNull(args.Current));
              }
          }
  </code></pre>
  
  <p>upon checking the pagecontext in the RenderingContext.Current it throws an exception. How can I have a value for the pagecontext?
  <a href="https://i.stack.imgur.com/unIRI.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/unIRI.png" alt="enter image description here"></a></p>