vendredi 6 mai 2016

Unit testing: mock static class used in my ViewModel

I am using a static class (MyStaticClass) inside a ViewModel:

public class MyViewModel : ViewModelBase
{
    public string MyProperty { get; set; }

    //whatever...

    public void FooMethod()
    {
        MyProperty = MyStaticClass.PropertyOne;
    }
}

My question is: how can I mock MyStaticClass in the MyViewModel unit tests?

Aucun commentaire:

Enregistrer un commentaire