C# xUnit member data getting data twice
<p>I have simple test project using xUnit. When I return new instance of a class (new <code>LinkConfig</code>) inside <code>GetTestData</code> method.
So while debugging, <code>GetTestData</code> method <strong>is called twice</strong> before all tests run. But it works fine if I return string instead of a new instance of a class.</p>
<pre><code>[Theory]
[MemberData(nameof(GetTestData))]
public void Test(LinkConfig config)
{ 
//Arrange
var url = config.Url;

//Act &amp; Assert 
Assert.Equal(&quot;http://google.com&quot;, url); 
}

public static IEnumerable&lt;object[]&gt; GetTestData()
{  
var config = new LinkConfig { Url = &quot;http://google.com&quot; }; 
yield return new object[] { config }; 
}
</code></pre>