KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I have a struct e.g.: public struct Foo { public int Bar; public string Baz; } and would like to create it in my unit tests using autofixture. I tried using the following: IFixture fixture = new Fixture(); var f = fixture.CreateAnonymous<Foo>(); But this throws an AutoFixture was unable to create an instance error. Is it possible to auto create a struct with autofixture? How could this be done? Please note, that I am working on legacy code and thus need to deal with structs. :) EDIT : Changed IFixture fixture = new Fixture().Customize(new AutoMoqCustomization()); To IFixture fixture = new Fixture(); Since it wasn't relevant for the question.
Tags (comma-separated)
Save Edits
Cancel