NSubstitute vs PRISM EventAggregator: Assert that calling a method triggers event with correct payload

前端 未结 3 1032
-上瘾入骨i
-上瘾入骨i 2020-12-21 09:39

Consider the below method that updates a person and publishes an event through the PRISM EventAggregator to indicate that the person has been updated.

I would like t

3条回答
  •  一生所求
    2020-12-21 09:55

    Just add a subscriber to your unit test and check the result of the delegate. See Prism's IEventAggregator unit tests as an example

    https://github.com/PrismLibrary/Prism/blob/master/Source/Prism.Tests/Events/PubSubEventFixture.cs#L14

提交回复
热议问题