src/Microsoft.VisualStudio.Editor.UnitTests/MyExtensibility/MyExtensibilitySettingsTest.cs
/// <summary>
/// Create a project mock. GetProjectItemTemplates will throw the given exception.
/// </summary>
Create a project mock. GetProjectItemTemplates will throw the given exception.
Create a project mock . GetProjectItemTemplates will throw the given exception .
private static Mock<Project> CreateProjectMockWithException(
            string projectKind, string customDataSignature, Exception ex)
        {
            Mock<Solution3> solution3Mock = new Mock<Solution3>(typeof(Solution));
            solution3Mock.Implement("GetProjectItemTemplates", new object[] { projectKind, customDataSignature }, ex);
            return CreateProjectMock(solution3Mock);
        }
private static Mock < Project > CreateProjectMockWithException ( string projectKind , string customDataSignature , Exception ex ) { Mock < Solution3 > solution3Mock = new Mock < Solution3 > ( typeof ( Solution ) ) ; solution3Mock . Implement ( " " , new object [ ] { projectKind , customDataSignature } , ex ) ; return CreateProjectMock ( solution3Mock ) ; }
Create a project mock.
Create a project mock .
// Mock of DTE.Solution // Solution.GetProjectItemTemplates implementation, throwing specified exception
projectKind
string
customDataSignature
string
ex
Exception