fsprojects / Avalonia.FuncUI

Develop cross-plattform GUI Applications using F# and Avalonia!
https://funcui.avaloniaui.net/
MIT License
944 stars 74 forks source link

Support for IView Unit Testing #353

Open Evelios opened 11 months ago

Evelios commented 11 months ago

I'm looking to be able to test some of my view creation modules and I'm looking to figure out the best way to go about that. There was issue #159 but all the links there are dead. I have not been able to find a way to accurately test all internal properties of the View components.

I was looking through current support you have for VirtualDom diffing through the VirtualDom.Differ.diff function. This functionality is understandable internal to the module. With access to information like that diff dela would give me the ability to write test wrappers for views that provides accurate view information.

That being said, I don't know if that is the right direction to go. I would like to be able to have the security knowing that the data flows and the view creation functions are working as expected.

JaggerJo commented 11 months ago

Happy to help with this. I guess you use the component model?

If so I'd start by modifying the Component class so that it allows you to inspect its internal state.

Later we can merge it..