public void TryFindSolutionFileInParentDirectory()
            {
                var directory = ExecutingAssemblyDll.Directory;

                Assert.AreEqual(true, CodeFactory.TryFindFileInParentDirectory(directory, "Gu.Roslyn.Asserts.sln", out var projectFile));
                Assert.AreEqual("Gu.Roslyn.Asserts.sln", projectFile.Name);
            }
            public void TryFindProjectFileInParentDirectory()
            {
                var directory       = ExecutingAssemblyDll.Directory;
                var projectFileName = Path.GetFileNameWithoutExtension(ExecutingAssemblyDll.FullName) + ".csproj";

                Assert.AreEqual(true, CodeFactory.TryFindFileInParentDirectory(directory, projectFileName, out var projectFile));
                Assert.AreEqual(projectFileName, projectFile.Name);
            }
            public void CreateSolutionFromSolutionFileAddsDependencies()
            {
                Assert.AreEqual(true, CodeFactory.TryFindFileInParentDirectory(ExecutingAssemblyDll.Directory, "Gu.Roslyn.Asserts.sln", out var solutionFile));
                var sln = CodeFactory.CreateSolution(
                    solutionFile,
                    new[] { new FieldNameMustNotBeginWithUnderscore() },
                    CreateMetadataReferences(typeof(object)));
                var assertsProject = sln.Projects.Single(x => x.Name == "Gu.Roslyn.Asserts");

                CollectionAssert.IsEmpty(assertsProject.AllProjectReferences);

                var testProject = sln.Projects.Single(x => x.Name == "Gu.Roslyn.Asserts.Tests");

                CollectionAssert.AreEqual(new[] { assertsProject.Id }, testProject.AllProjectReferences.Select(x => x.ProjectId).ToArray());
            }