forked from dotnet/project-system
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge features/languageservice -> master
- Loading branch information
Showing
74 changed files
with
1,538 additions
and
2,610 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
....VisualStudio.ProjectSystem.Managed.UnitTests/Mocks/IActiveEditorContextTrackerFactory.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. | ||
|
||
using System; | ||
|
||
using Microsoft.VisualStudio.LanguageServices.ProjectSystem; | ||
|
||
using Moq; | ||
|
||
namespace Microsoft.VisualStudio.ProjectSystem.LanguageServices | ||
{ | ||
internal static class IActiveEditorContextTrackerFactory | ||
{ | ||
public static IActiveEditorContextTracker Create() | ||
{ | ||
return Mock.Of<IActiveEditorContextTracker>(); | ||
} | ||
|
||
public static IActiveEditorContextTracker ImplementIsActiveEditorContext(Func<IWorkspaceProjectContext, bool> action) | ||
{ | ||
var mock = new Mock<IActiveEditorContextTracker>(); | ||
mock.Setup(t => t.IsActiveEditorContext(It.IsAny<IWorkspaceProjectContext>())) | ||
.Returns(action); | ||
|
||
return mock.Object; | ||
} | ||
|
||
public static IActiveEditorContextTracker ImplementReleaseContext(Action<IWorkspaceProjectContext> action) | ||
{ | ||
var mock = new Mock<IActiveEditorContextTracker>(); | ||
mock.Setup(t => t.UnregisterContext(It.IsAny<IWorkspaceProjectContext>())) | ||
.Callback(action); | ||
|
||
return mock.Object; | ||
} | ||
|
||
public static IActiveEditorContextTracker ImplementRegisterContext(Action<IWorkspaceProjectContext, string> action) | ||
{ | ||
var mock = new Mock<IActiveEditorContextTracker>(); | ||
mock.Setup(t => t.RegisterContext(It.IsAny<IWorkspaceProjectContext>(), It.IsAny<string>())) | ||
.Callback(action); | ||
|
||
return mock.Object; | ||
} | ||
} | ||
} |
45 changes: 0 additions & 45 deletions
45
...dio.ProjectSystem.Managed.UnitTests/Mocks/IActiveWorkspaceProjectContextTrackerFactory.cs
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
...alStudio.ProjectSystem.Managed.UnitTests/Mocks/IWorkspaceProjectContextAccessorFactory.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. | ||
|
||
using System; | ||
using Microsoft.VisualStudio.LanguageServices.ProjectSystem; | ||
using Moq; | ||
|
||
namespace Microsoft.VisualStudio.ProjectSystem.LanguageServices | ||
{ | ||
internal static class IWorkspaceProjectContextAccessorFactory | ||
{ | ||
public static IWorkspaceProjectContextAccessor ImplementContext(IWorkspaceProjectContext context, string contextId = null) | ||
{ | ||
var mock = new Mock<IWorkspaceProjectContextAccessor>(); | ||
|
||
mock.Setup(c => c.Context) | ||
.Returns(context); | ||
|
||
mock.Setup(c => c.ContextId) | ||
.Returns(contextId); | ||
|
||
return mock.Object; | ||
} | ||
|
||
public static IWorkspaceProjectContextAccessor ImplementHostSpecificErrorReporter(Func<object> action) | ||
{ | ||
var mock = new Mock<IWorkspaceProjectContextAccessor>(); | ||
|
||
mock.SetupGet(c => c.HostSpecificErrorReporter) | ||
.Returns(action); | ||
|
||
return mock.Object; | ||
} | ||
|
||
public static IWorkspaceProjectContextAccessor Create() | ||
{ | ||
var context = IWorkspaceProjectContextMockFactory.Create(); | ||
|
||
return ImplementContext(context); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 3 additions & 4 deletions
7
...VisualStudio.ProjectSystem.Managed.UnitTests/Mocks/WorkspaceProjectContextProviderMock.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.