title: Why when I use some queries in unit tests the created item doesn't load?
body: <p>I'm using <strong>XUnit</strong> on the <strong>boilerplate</strong> (abp 6.0.0) and in the unit test example below I'm creating a &quot;SwitchDto&quot; and in the variable &quot;isHere&quot; I checked it and it was created.</p>
  <pre><code>[Fact]
  public async Task Test_Example()
  {
      var switchDto = await _switchAppService.CreateAsync(SwitchTr1_Valid_Dto);
      var id = switchDto.Id;
      
      await UsingDbContextAsync(async context =&gt;
      {
          var isHere = await context.Switch.FirstOrDefaultAsync(u =&gt; u.Id == id);
      });
  
      using var switchController = new SwitchController(_switchAppService);
      using var switchInterfaceController = new SwitchInterfaceController(_switchInterfaceAppService);
  
      switchDto = await _switchAppService.UpdateAsync(switchDto);
      switchDto.Hostname.ShouldBe(&quot;switchHost&quot;);
  
      await UsingDbContextAsync(async context =&gt;
      {
          var _switch = await context.Switch.FirstOrDefaultAsync(u =&gt; u.Id == id);
          _switch.ShouldNotBeNull();
          _switch.SerialNumber.ShouldBe(&quot;5678&quot;);
      });
  }
  </code></pre>
  <p>But on &quot;UpdateAsync&quot; I get an error during a validation as it can't find the &quot;switch&quot; created in the method below:</p>
  <pre><code>public override async Task&lt;SwitchDto&gt; GetAsync(EntityDto&lt;int&gt; input)
  {
      CheckGetPermission();
  
      Switch sw = await Repository.GetAllIncluding(i =&gt; i.TechnicalRoom)
          .Include(i =&gt; i.SwitchManufacturerModel)
          .ThenInclude(i =&gt; i.SwitchBrand)
          .FirstOrDefaultAsync(x =&gt; x.Id == input.Id);
  
      return MapToEntityDto(sw);
  }
  </code></pre>
  <p><strong>I already tried</strong> to execute the <code>UpdateAsync</code> method in the block <code>UsingDbContextAsync</code>.</p>
  <p>The problem only happens during unit tests, if I run the application the same method brings the values normally.</p>
  <p>Why when I use this queries above the created item doesn't load?</p>