Microsoft Shims cannot debug method under testing

I have a test method that is good when I run it, but it fails with an exception when debugging. Below is the tested method and the output from VS Test Runner below. The exception is ShimsContext.Create ()

Info: VS 2012 Permium Update2 enter image description here

[TestMethod] public void TestResolveDateWithShim() { using (ShimsContext.Create()) { // arrange DateTime someTestTime = new DateTime(2013, 1, 14); Fakes.ShimDateHelper.PreviousOrCurrentQuarterEndDateTime = time => someTestTime; var appCache = new Fakes.StubIAppCache(); var series = new StubISeries(); series.KeyGet = () => SeriesKey.MyKey; // act Report report = new Report(SeriesKey.MyKey, appCache); DateTime resolvedDate = report.ResolveDate(series, DateTime.Now); // assert Assert.AreEqual(someTestTime, someTestTime); } 
+4
source share
1 answer

I solved it. This was the problem that caused the problems. On the resharper tab under the options. In the Tools-> Device Testing → MSTest section, I unchecked the "Use obsolete runner" checkbox. Now it works, and I can still use resharper to help me test. I cannot disable all test parameters in resharper, but it also works, but I want some parameters to be changed, because they are very useful.

+6
source

Source: https://habr.com/ru/post/1484692/


All Articles