Pack Urls and Unit Testing. Problem with my environment?

后端 未结 4 1049
陌清茗
陌清茗 2021-02-07 04:45

So I\'ve got this nice little MVVM solution, and things work great. I\'ve got a view model for a header bar that adjusts the icon based on the state of the application, etc. I\'

4条回答
  •  不要未来只要你来
    2021-02-07 05:08

    A small code sample to add to the answers above. We use the following in a unit test to get around this issue.

        [AssemblyInitialize]
        public static void MagicHappensHere(TestContext context) {
    
            PackUriHelper.Create(new Uri("reliable://0"));
        }
    

    Once this has been called at the test startup it all works perfectly.

提交回复
热议问题