title: Mock repository is returning null
body: <p>I am writing a simple xunit test case for a service class.
  I have mocked <code>_userAPIRepository</code> but it returns <em>null</em> value. It should return <code>teacherDetails</code>.</p>
  <p>Below is the service class method and xunit test case method.</p>
  <p><strong>Service method</strong></p>
  <pre><code>public async Task&lt;List&lt;TeacherDto&gt;&gt; GetTeacherDetails(Teacher teacher)
  {
      List&lt;TeacherDto&gt; teacherDetails = new List&lt;TeacherDto&gt;();
      UserByUsername userByUsername = new UserByUsername
      {
          Username = teacher.Name,
          Id       = teacher.Id
      };
  
      teacherDetails = await _userServiceAPI.GetUserIdsByName(userByUsername);
           
      return teacherDetails;
           
  }
  </code></pre>
  <p><strong>xunit test case</strong></p>
  <pre><code>[Fact()]
  public async Task GetUserDetails()
  {
      //Arrange
      List&lt;TeacherDto&gt; teacherDetails = ServiceDataSource.teacherDetails();
      Teacher teacher =  ServiceDataSource.teacher();
       
      UserByUsername userByUsername = new UserByUsername
      {
          Username = teacher.Name,
          Id       = teacher.Id
      };
       
      _userAPIRepository.Setup(x =&gt; x.GetUserIdsByName(userByUsername)).Returns(Task.FromResult(teacherDetails);
              
       
      var result = await _userServiceAPI.GetTeacherDetails(teacher);
       
      //Assert
      Assert.True(result.Count &gt; 0);
  }
  </code></pre>