ArchiMetrics.Analysis.Tests.SolutionTestsBase.CreateSolution C# (CSharp) Метод

CreateSolution() защищенный Метод

protected CreateSolution ( ) : Microsoft.CodeAnalysis.Solution
Результат Microsoft.CodeAnalysis.Solution
		protected Solution CreateSolution(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;
			seed = seed.AddMetadataReference(projId, MetadataReference.CreateFromFile(typeof(object).Assembly.Location));

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

			return solution;
		}
	}
SolutionTestsBase