Visual Studio 2015, Microsoft Fakes, and System.Security.Claims.Claim

I have an interface in the .NET 4.5 class library (not 4.6),

public interface IBrokenFakeInterface { Claim WhyWontItGenerateFakeOfThisInterface(); } 

In my unit test (MSTest) project, when I added Fakes for the corresponding assembly containing this interface, I get a compiler warning saying that it cannot create a stub.

Warning: it is not possible to create a stub for ClassLibrary1.IBrokenFakeInterface: method System.Security.Claims.Claim ClassLibrary1.IBrokenFakeInterface.WhyWontItGenerateFakeOfThisInterface () unubbable: the method is abstract and cannot be cut, the type System.Security.Claims.Claim is not available in the target structure. ClassLibrary1Tests C: \ Users \ jacobsonba \ Documents \ Visual Studio 2015 \ Projects_tempFakeFiguringOut \ ClassLibrary1Tests \ Fakes \ ClassLibrary1.fakes

Although this is only a compiler warning, it leads to compiler errors when the unit test project relies on a StubIBrokenFakeInterface because a specific Stub type is not created by the fake generator.

Does anyone know the cause of this error and the resolution? Changing projects to .NET 4.6 allows it, but this is not a reasonable option for these projects for us. The exact code is compiled simply in VS2013; in fact, if it is compiled with VS2013, then open the solution in VS2015, it continues to work until the Fakes assembly is regenerated. Thus, it is obvious that the problem is in the fake generator that uses VS2015.

+4
visual-studio-2015 microsoft-fakes
Jul 21 '15 at 13:50
source share

No one has answered this question yet.

See similar questions:

46
Visual Studio 2015 provides backward compatibility with Visual Studio 2013
2
Microsoft Fakes cannot create stub

or similar:

28
Visual Studio 2015 InvalidProgramException in Unit Test with fakes
24
Why are additional parameters passed with invalid values ​​in Visual Studio 2015?
8
Fakes stopped working after installing Visual Studio 2015
6
Counterfeit assembly does not generate
6
Fake Broken in Visual Studio 2015
2
Microsoft fakes assembly name conflict
2
Visual Studio 2015 compilation error: CS0570 is not supported by the language
2
Failed to create fakes for assembly referencing portable class library
2
Microsoft Fakes cannot create stub
0
Microsoft Fakes cannot find the ICollection and IDictionary interfaces.



All Articles