This is essentially an artefact of how the C# compiler treats value types. While the documentation seems to indicate otherwise, from the perspective of Reflection, the Foo struct has no public constructors.
E.g. if you execute this code:
var ctors = typeof(Foo).GetConstructors();
the result is an empty array.
However, this code compiles:
var f = new Foo();
so you could argue that AutoFixture should be able to create an instance of Foo.
However, in the end, mutable structs are evil and should be avoided at all cost. A better option is to change the Foo implementation to this:
public struct Foo
{
public Foo(int bar, string baz)
{
this.Bar = bar;
this.Baz = baz;
}
public readonly int Bar;
public readonly string Baz;
}
If you do this, not only do you now have a (more) correct value type, but AutoFixture is also able to create an instance without further modification.
Thus, this is a pretty good example of the GOOS paradigm that you should listen to your tests. If they present friction, it might be feedback about your production code. In this case, this is exactly feedback that you're about to shoot yourself in the foot because the value type implementation is flawed.
P.S. Even if you 'fix' the Foo struct like outlined above, what's the point of making it a struct instead of a class? It still contains a string (reference types) field, so even though the struct itself is going to live on the stack, the string field is still going to point to data in the heap.
I've added this issue as a possible new feature for AutoFixture.