コード例 #1
0
ファイル: SolutionSizeTests.cs プロジェクト: GloryChou/roslyn
        public void Test_RemoveDocument()
        {
            var expected = 12345;
            var solution = CreateSolution(expected);

            var analyzer = new SolutionSizeTracker.IncrementalAnalyzer();

            // initialize
            analyzer.NewSolutionSnapshotAsync(solution, CancellationToken.None).Wait();
            AddSolution(analyzer, solution);

            // remove document
            var document = solution.Projects.First().Documents.First();
            analyzer.RemoveDocument(document.Id);

            var size = analyzer.GetSolutionSize(solution.Id);

            var length = document.GetSyntaxTreeAsync().Result.Length;
            Assert.Equal(expected - length, size);
        }