xUnit has class fixtures but if I undersand correctly there's no way to inject one fixture into another, for example by specifying it as a dependency in constructor:
public class UserFixture
{
public User User;
public UserFixture()
{
// Create user
}
}
public class UserClientFixture
{
public HttpClient HttpClient;
public UserClientFixture(
UserFixture userFixture
)
{
HttpClient = ...; // Create http client using userFixture
}
}
public class UserFixture
{
public User User;
public UserFixture()
{
// Create user
}
}
public class UserClientFixture
{
public HttpClient HttpClient;
public UserClientFixture(
UserFixture userFixture
)
{
HttpClient = ...; // Create http client using userFixture