Caliburn-Micro / Caliburn.Micro

A small, yet powerful framework, designed for building applications across all XAML platforms. Its strong support for MV* patterns will enable you to build your solution quickly, without the need to sacrifice code quality or testability.
http://caliburnmicro.com/
MIT License
2.8k stars 778 forks source link

Caliburn.Micro and multitasking testing #796

Open tapika opened 2 years ago

tapika commented 2 years ago

Following API's

IoC.GetInstance
IoC.GetAllInstances
IoC.BuildUp

are by default global statics.

Meanwhile - I would like to use multitasking for UI testing if and when it's possible.

Would it be possible to re-design Caliburn.Micro so it would allow use of multitasking for UI testing ?

In theory you could use AsyncLocal instead of global static variable.

KasperSK commented 2 years ago

I am not sure that I follow the issue here. Perhaps I am not familiar with 'multitasking for UI testing' could you elaborate?

tapika commented 2 years ago

Hmm... I by myself never tried actually to run UI with multitasking testing.

But independently of that - I think it should be possible to launch multiple unit tests, where each task will have it's own instance of caliburn micro container. Having global static variables like above is not from multitasked unit test perspective.