Do you know the MsTest.exe is 32 bit by default. MS is yet to come up with 64 bit version of this exe, to run the tests in 64 bit mode.
Found the following steps in one of the useful post on Stackoverflow: http://stackoverflow.com/questions/5880337/run-tests-in-64-bit
1.Backup mstest.exe and run CorFlags.exe MSTest.exe /32BIT- /Force to remove the 32-bit flag
2.Run your tests with /noisolation: MSTest.exe /testcontainer: /resultsfile: /noisolation
Tried validate the 3 step from post on my windows 7 machine but could not be validated so skipping that.
Good to have new Patterns to design your applications. MVVM is such one pattern.
I assume the reader of this post has basic understanding of what MVVM stands for.
MVVM gives the flexibility to handle the User action in ViewModel using ICommand property. However this brings another challenge for developer of unit test this.
Consider a sample ICommand:
public ICommand ClearCommand
if (this.infClearCommand == null)
this.infClearCommand = new RelayCommand(
this.SelectedFileName = string.Empty;
this.infFileReader = null;
Now to unit test this piece of code:
public void Test()
ABCViewModel target = new ABCViewModel();
target.SelectedFileName = "XYZ";
ICommand.Execute will take care of the Unit Test for you.
While working on a WPF application, we created the automated unit tests. Application was developed using MVVM pattern.
Using MS Test we were able to test the Model, View Model but another challenge was how to ensure the binding is correct?
We created a utility which help us test the binding, as well as check the static property of controls used on each UI.
UI and its binding are testable now and are part of Automated unit test!