Skip to content

v1.2.1 Unit Test Friendly

Compare
Choose a tag to compare
@mysteryx93 mysteryx93 released this 29 May 20:43
· 101 commits to master since this release

Version 1.2.1 is ready!

Made the library more friendly for unit tests. One area that caused trouble is the creation of the
dialog view model new MyDialogViewModel(). If it has dependencies, you might use Locator.MyDialogViewModel,
but then that's not unit-test friendly.

As a solution, you will now create the view model using
IDialogService.CreateViewModel<T>.
It will call a ViewModelFactory function set in the DialogService constructor.

  • Added viewModelFactory parameter to DialogService constructor
  • Moved viewLocator constructor parameter from DialogService to DialogManager
  • Updated all demos to use correct constructor parameters
  • Updated all demos to use IDialogService.CreateViewModel<T>
  • Added unit test sample project: Demo.ModalDialog.Tests