Unit testing the Viewmodel

前端 未结 6 2084
既然无缘
既然无缘 2021-02-05 18:03

I am sort of new to TDD. I have started creating the properties I need on the view model as plain auto property.

public string Firstname { get; set; }

6条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-02-05 18:35

    You need to have another test that actually asserts that your PropertyChanged even fires.

    When you make that test, then your auto property should fail, because the event will never fire.

    Here's an example of how to do that in Moq

提交回复
热议问题