File tree Expand file tree Collapse file tree 2 files changed +28
-15
lines changed
src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test Expand file tree Collapse file tree 2 files changed +28
-15
lines changed Original file line number Diff line number Diff line change
1
+ // Licensed to the .NET Foundation under one or more agreements.
2
+ // The .NET Foundation licenses this file to you under the MIT license.
3
+
4
+ using System . Collections . Immutable ;
5
+ using System . Threading . Tasks ;
6
+ using Microsoft . CodeAnalysis . Razor . ProjectSystem ;
7
+
8
+ namespace Microsoft . AspNetCore . Razor . LanguageServer . ProjectSystem ;
9
+
10
+ internal sealed class TestRazorProjectInfoDriver : IRazorProjectInfoDriver
11
+ {
12
+ public static readonly TestRazorProjectInfoDriver Instance = new ( ) ;
13
+
14
+ public void AddListener ( IRazorProjectInfoListener listener )
15
+ {
16
+ }
17
+
18
+ public ImmutableArray < RazorProjectInfo > GetLatestProjectInfo ( )
19
+ {
20
+ return [ ] ;
21
+ }
22
+
23
+ public Task WaitForInitializationAsync ( )
24
+ {
25
+ return Task . CompletedTask ;
26
+ }
27
+ }
Original file line number Diff line number Diff line change 5
5
using System . Threading . Tasks ;
6
6
using Microsoft . AspNetCore . Razor . Language ;
7
7
using Microsoft . AspNetCore . Razor . LanguageServer . Common ;
8
- using Microsoft . AspNetCore . Razor . Test . Common ;
9
8
using Microsoft . CodeAnalysis . Razor . Logging ;
10
9
using Microsoft . CodeAnalysis . Razor . ProjectSystem ;
11
10
using Microsoft . CodeAnalysis . Razor . Serialization ;
12
11
using Microsoft . CodeAnalysis . Razor . Utilities ;
13
- using Moq ;
14
12
15
13
namespace Microsoft . AspNetCore . Razor . LanguageServer . ProjectSystem ;
16
14
@@ -20,24 +18,12 @@ internal class TestRazorProjectService(
20
18
ILoggerFactory loggerFactory )
21
19
: RazorProjectService (
22
20
projectManager ,
23
- CreateProjectInfoDriver ( ) ,
21
+ TestRazorProjectInfoDriver . Instance ,
24
22
remoteTextLoaderFactory ,
25
23
loggerFactory )
26
24
{
27
25
private readonly ProjectSnapshotManager _projectManager = projectManager ;
28
26
29
- private static IRazorProjectInfoDriver CreateProjectInfoDriver ( )
30
- {
31
- var mock = new StrictMock < IRazorProjectInfoDriver > ( ) ;
32
-
33
- mock . Setup ( x => x . GetLatestProjectInfo ( ) )
34
- . Returns ( [ ] ) ;
35
-
36
- mock . Setup ( x => x . AddListener ( It . IsAny < IRazorProjectInfoListener > ( ) ) ) ;
37
-
38
- return mock . Object ;
39
- }
40
-
41
27
public async Task AddDocumentToPotentialProjectsAsync ( string filePath , CancellationToken cancellationToken )
42
28
{
43
29
foreach ( var projectSnapshot in _projectManager . FindPotentialProjects ( filePath ) )
You can’t perform that action at this time.
0 commit comments