Mar 14, 2012 at 12:16 PM
Edited Mar 14, 2012 at 12:16 PM
First up... I'm a fan! I still haven't wrapped my head around the Coroutines stuff in the Mix10 talk but that's me not being able to concentrate :)
Here's my question.(I've gone through Rob's Mix10 talk > 2 times ; though not really built non-trivial apps with caliburn. So have a slight idea about the theory but no practice).
Caliburn.Micro is a View-Model first framework (which is great).
I'm assuming that the preferred approach of composing the app is also via composing viewmodels (and attaching the right views to them as a secondary step)
Following the MVP / MVVM pattern has made unit tests easy. Does Caliburn.Micro scale this idea to the system-level too ? (More
details on where I'm headed). I'm trying to "peel the UI off" the app and test via the VM layer.
Technically I'd like to
- load up the whole app in-process within my test-runner process
- then find existing ViewModel instances from the container (this step should fail if an instance doesn't exist at that point of time).. i.e. this is != _container.ComposeExportedValue<VMType>
- prod and poke the VM properties/commands to manipulate the app
Does this appear feasible with Caliburn ?
public void TestSomething()
InitializeApp(); // do whatever is needed to mimic startup
var vm = GetViewModel<LoginViewModel>()
vm.UserName = "uname"
vm.Password = "pwd"
How difficult would it be to implement InitializeApp() and GetViewModel ?
I see the Bootstrapper takes a UseApplication flag that looks useful. RFC