WPF Login Demo with MVVM pattern – update

After the first example posted, here are some improvements:

1. Moved business layer into separate project for testing
2. Added a quick test project (with some BDD flavors)
3. Tests are targeting only the ViewModel.
4. Refactored the intentional first naive ICommand implementations (towards Prism via DelegateCommand, although RelayCommand or SimpleCommand can be used also).
5. Still DIDN’T added yet the AttachedProperty to the PasswordBox for simulate a more realistic login. Password is still a TextBox just for clarity.

Small exercise: how to not duplicate the validation logic in CanLoginExecute?

In a future update I intend to add also a Silverlight login demo, based on that example.

Grab the code from here:

  LoginExample-0.0.2.1040.zip (84.9 KiB, 858 hits)


And that’s how the tests are looking (clearer, right?):
BDD Testing with MSTest

emipasat posted at 2009-9-30 Category: Development/Programming | Tags: , , , ,

One Response Leave a comment

    Leave a Reply

    (Ctrl + Enter)