コード例 #1
0
            private async Task ValidateChecksumAsync(Checksum checksumFromRequest, Solution incrementalSolutionBuilt)
            {
                var currentSolutionChecksum = await incrementalSolutionBuilt.State.GetChecksumAsync(CancellationToken.None).ConfigureAwait(false);

                if (checksumFromRequest == currentSolutionChecksum)
                {
                    return;
                }

                var(solutionInfo, options) = await _assetProvider.CreateSolutionInfoAndOptionsAsync(checksumFromRequest, _cancellationToken).ConfigureAwait(false);

                var workspace = new AdhocWorkspace(_hostServices);

                workspace.AddSolution(solutionInfo);
                workspace.SetCurrentSolution(s => s.WithOptions(options), WorkspaceChangeKind.SolutionChanged);

                await TestUtils.AssertChecksumsAsync(_assetProvider, checksumFromRequest, workspace.CurrentSolution, incrementalSolutionBuilt).ConfigureAwait(false);
            }