title: assert.isNotNull failing on unit test populated as part of scope
body: <p>I am new to unit testing and I am attempting to write a test that calls a controllers get action based on a GUID:</p>
  
  <pre><code>[TestClass]
  public class DocumentControllerTests : TestBase
  {
      [TestMethod, TestCategory(Unit)]
      public void DocumentController_Get_Returns_Ok()
      {
          //
          // arrange
          //
          var scope = new DefaultScope();
          var expected = Builder&lt;Dom.Document&gt;
              .CreateListOfSize(1)
              .Build();
          scope.DocumentProviderMock
              .Setup(x =&gt; x.GetAllAsync())
              .ReturnsAsync(expected);
  
          //
          // act &amp; assert
          //
          var testId = scope.TestId;
          var actual = scope.InstanceUnderTest.Get(testId)
              .AssertOk&lt;List&lt;Api.Document&gt;&gt;()
              .Content;
          expected.ShouldBeEquivalentTo(actual, opt =&gt; opt.ExcludingMissingMembers());
      }
  </code></pre>
  
  <p>Here is the scope class defined:</p>
  
  <pre><code>    private class DefaultScope : TestScope&lt;DocumentController&gt;
      {
          /// &lt;summary&gt;
          ///     initializes a new instance of the
          ///     Deloitte.DCIPP.Tests.Web.Service.DocumentStore.DocumentControllerTests.DefaultScope class.
          /// &lt;/summary&gt;
          public DefaultScope()
          {
              LoggingProviderMock = new Mock&lt;ILoggingProvider&gt;();
              DocumentProviderMock = new Mock&lt;IDocumentProvider&gt;();
              DependencyResolverMock =
                  MockDependencyResolverFor&lt;IResourceUrlBuilder, ResourceUrlBuilder&gt;(new ResourceUrlBuilder());
              TestId = Guid.NewGuid();
  
              TestWebDocument = Builder&lt;Api.Document&gt;
                  .CreateNew()
                  .Build();
  
              TestDocument = BuildDomainDocument(TestId);
  
  
              // use standard maps
              AutoMapperConfig.RegisterMaps(Mapper.Configuration, DependencyResolverMock);
  
              InstanceUnderTest = new DocumentController(DocumentProviderMock.Object, LoggingProviderMock.Object,
                  Mapper.Engine);
  
              BootstrapControllerContext(InstanceUnderTest);
          }
  
          /// &lt;summary&gt;
          ///     Gets or sets the dependency resolver mock.
          /// &lt;/summary&gt;
          /// &lt;value&gt;The dependency resolver mock.&lt;/value&gt;
          public IDependencyResolver DependencyResolverMock { get; }
  
          /// &lt;summary&gt;
          ///     Log Category all messages will be associated with.
          /// &lt;/summary&gt;
          /// &lt;value&gt;The expected log categories.&lt;/value&gt;
          public LogCategories ExpectedLogCategories { get; } = LogCategories.DocumentStoreService;
  
          /// &lt;summary&gt;
          ///     Gets the logging provider mock.
          /// &lt;/summary&gt;
          /// &lt;value&gt;The logging provider mock.&lt;/value&gt;
          public Mock&lt;ILoggingProvider&gt; LoggingProviderMock { get; }
  
          /// &lt;summary&gt;
          ///     Gets the Document provider mock.
          /// &lt;/summary&gt;
          /// &lt;value&gt;The Document provider mock.&lt;/value&gt;
          public Mock&lt;IDocumentProvider&gt; DocumentProviderMock { get; }
  
          /// &lt;summary&gt;
          ///     Gets the identifier of the test.
          /// &lt;/summary&gt;
          /// &lt;value&gt;The identifier of the test.&lt;/value&gt;
          public Guid TestId { get; }
  
          /// &lt;summary&gt;
          ///     Gets or sets the test Document.
          /// &lt;/summary&gt;
          /// &lt;value&gt;The test Document.&lt;/value&gt;
          public Dom.Document TestDocument { get; set; }
  
          public Api.Document TestWebDocument { get; }
  
          public Dom.Document BuildDomainDocument(Guid expectedId)
          {
              // Invoke GetBytes method.
              var array = Encoding.ASCII.GetBytes("Byte Controller Test");
  
              return Builder&lt;Dom.Document&gt;
                  .CreateNew()
                  .With(x =&gt; x.Id, expectedId)
                  .With(t =&gt; t.Data = array)
                  .Build();
          }
      }
  </code></pre>
  
  <p>When I run the test I am getting an exception on line:</p>
  
  <pre><code>            .AssertOk&lt;List&lt;Api.Document&gt;&gt;()
  </code></pre>
  
  <p>Thhis method is called from another class but it's relatively straightforward. The error I am getting is that assert.isNotNull is failing:</p>
  
  <p><a href="https://i.stack.imgur.com/09ZoN.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/09ZoN.png" alt="enter image description here"></a></p>
  
  <p>I don't understand why it's null as I populate the scope before hand.</p>
  
  <p>What am I doing wrong and how do I fix it?</p>