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 
[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); }
source share