Running MSTest as 64 bit

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:

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.


Unit test the ICommand Property of ViewModel – MVVM Pattern

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(
                        param =>
                            this.SelectedFileName = string.Empty;
                            this.infFileReader = null;
                        param =>
                             return true;
                 return this.infClearCommand;             

Now to unit test this piece of code:

public void Test()
    ABCViewModel target = new ABCViewModel(); 
    target.SelectedFileName = "XYZ";
    Assert.AreEqual(target.SelectedFileName, string.Empty);

ICommand.Execute will take care of the Unit Test for you.

WPF UI Automated Unit testing

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!