protected void UseSampleSolution([NotNull] Action <ISolution> testAction)
        {
            var solutionFilePath = FileSystemPath.Parse(TestDataPathUtility.GetPathRelativeToSolution("ImplicitNullability.Sample.sln"));

            DoTestSolution(solutionFilePath, (lifetime, solution) => { testAction(solution); });

            // Close the solution to isolate all solution-level settings changes (this has a small performance hit because normally the
            // solution is only "cleaned" at the end of DoTestSolution())
            RunGuarded(() => CloseSolution());
        }
Esempio n. 2
0
        protected void UseSampleSolution(Action <ISolution, IContextBoundSettingsStore> testAction)
        {
            var solutionFilePath = FileSystemPath.Parse(TestDataPathUtility.GetPathRelativeToSolution("ImplicitNullability.Sample.sln"));

            ExecuteWithinSettingsTransaction(settingsStore =>
            {
                DoTestSolution(solutionFilePath, (lifetime, solution) =>
                {
                    // We need to change the settings by code (via `settingsStore`), because the settings stored in the .DotSettings files aren't
                    // evaluated (see https://resharper-support.jetbrains.com/hc/en-us/community/posts/206628865).

                    testAction(solution, settingsStore);
                });
            });
        }