ArchiMetrics.CodeReview.Rules.Tests.Rules.SolutionTestsBase.CreateSolution C# (CSharp) Method

CreateSolution() protected static method

protected static CreateSolution ( IEnumerable references ) : Microsoft.CodeAnalysis.Solution
references IEnumerable
return Microsoft.CodeAnalysis.Solution
		protected static Solution CreateSolution(IEnumerable<MetadataReference> references, params string[] code)
		{
			var workspace = new AdhocWorkspace();

			var x = 1;
			var seed = workspace.CurrentSolution.AddProject(ProjectId.CreateNewId("testcode"), "testcode", "testcode.dll", LanguageNames.CSharp);

			var projId = seed.Projects.First().Id;

			var solution = references.Aggregate(
				seed, 
				(sol, r) => sol.AddMetadataReference(projId, r));

			solution = code.Aggregate(
				solution, 
				(sol, c) => sol.AddDocument(DocumentId.CreateNewId(projId), string.Format("TestClass{0}.cs", x++), c));

			return solution;
		}
	}

Same methods

SolutionTestsBase::CreateSolution ( ) : Microsoft.CodeAnalysis.Solution
SolutionTestsBase