Should FakesAssemblies files be added to source control?

mocking, unit-testing, visual-studio-2012

Solution

Being auto-generated shouldn't be discriminating factor for presence in repository. After all, all kinds of auto-generated files make their way there fairly often - for example designer files.

Problem is, generating extra fakes assembly all the time could be time consuming. Microsoft posts guidelines on how you can try to optimize that:

The compilation of Fakes assemblies can significantly increase your build time. You can minimize the build time by generating the Fakes assemblies for .NET System assemblies and third-party assemblies in a separate centralized project. Because such assemblies rarely change on your machine, you can reuse the generated Fakes assemblies in other projects.

So, rarely-changing, .NET FCL / 3rd party based fake assemblies should be part of repository to speed up build process. The ones based on your own code, are probably best generated on the fly.

Problem

The new Fakes framework in VS11 allows you to create fake (mock or stub) implementations of assembly references in a Unit Test project. When an assembly is faked, VS11 generates two files for each fake: ``` /FakesAssemblies/[Project].Fakes.dll /FakesAssemblies/[Project].Fakes.xml ``` Should these files be added to source control? My assumption is no, because they are auto-generated, but wondered if anyone had other opinions.

Original source

Related problems