title: Is there any way to resolve the Assert.Istype() failure Issue?
body: <p>When I Am writing <code>test_case</code> for <code>details_byId</code> the <code>Assert.Istype()</code> failure</p>
  
  <pre><code>[Fact]
  public  void Get_DetailsbyId_NotFound()
  {
      //ILoggerMocking
  
      var serviceProvider = new ServiceCollection()
     .AddLogging()
      .BuildServiceProvider();
  
      var factory = serviceProvider.GetService&lt;ILoggerFactory&gt;();
  
      var logger = factory.CreateLogger&lt;DetailsAPIController&gt;();
  
      //Act
      detailsAPIController = new DetailsAPIController(detailsByIdTestCasePreparation.mockContext.Object, logger);
      //Arrange
      var res = detailsAPIController.GetDetails(22);
      //Assert
      Assert.IsType&lt;NotFoundResult&gt;(res);
  
  }
  </code></pre>
  
  <p>GetDetailsMethod</p>
  
  <pre><code>[Route("{id}")]
  public IActionResult GetDetails(int id)
  {
      _logger.LogInformation("Get details API called");
  
      try
      {
          return Ok(_detailsbyIdRepository.GetDetails(id));
  
      }
      catch (Exception ex)
      {
          _logger.LogError("An error was thrown because: "+ex.Message);
          return BadRequest(ex);
      }
  }
  </code></pre>
  
  <p>In the above the <code>Assert.IsType</code> is failure actual I'm trying to <code>bad_request</code> but it getting <code>OkObjectResult</code></p>
  
  <pre><code>Expected: Microsoft.AspNetCore.Mvc.NotFoundResult
  Actual:  Microsoft.AspNetCore.Mvc.OkObjectResult
  </code></pre>
  
  <p>Can any one help out form it</p>