I have a very simple test that uses a shim but when I run the test I get a "ShimNotSupportedException". I am using VS2013 Ultimate and I am not debugging.
[TestMethod]
public void GetDateTimeString_ReturnDTString_SetDateTime_CurrentYear()
{
using (ShimsContext.Create())
{
// Set 'UtcNow' to 1 March 2014
ShimDateTime.UtcNowGet = () => new DateTime(2014, 3, 1, 5, 30, 28);
var inputDate = new DateTime(2014, 06, 20, 18, 33, 50);
// Act
var actual = CustomTimeHelper.GetDateTimeString(inputDate);
// Assert
Assert.IsNotNull(actual);
}
}
I have tried the following with no success
If anyone has any ideas as to what might be happening or how to resolve the issue, it would be greatly appreciated.
The issue was coming from referencing version 11.0.0.0 of Microsoft.QualityTools.Testing.Fakes.
The following steps fixed the issue for me.