Skip to content

Undesirable side effect of all property getters being called during initialization #4049

@Dalet

Description

@Dalet

A recent change broke my tests after upgrading because TUnit now calls all property getters during initialization

var value = property.GetValue(obj);

Now my custom WebApplicationFactory class app host is built right after being injected (when the Server property is accessed), before I even have a chance to configure it.

I could refactor around this but this seems like an undesirable behavior in the first place. Why not initialize only the properties that have the ClassDataSource attribute?

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions