Here is what I am trying to do:
public class MyTests
{
private IFixture _fixture;
public MyTests()
{
_fixture = new Fixture();
_fixture.Customize<Thing>(x => x.With(y => y.UserId, 1));
}
[Theory, AutoData]
public void GetThingsByUserId_ShouldReturnThings(IEnumerable<Thing> things)
{
things.First().UserId.Should().Be(1);
}
}
I would expect the IEnumerable<Thing> things
parameter passed into the test to each have a UserId
of 1 but this is not what happens.
How can I make this so?