src/Microsoft.VisualStudio.Editor.UnitTests/MyExtensibility/MyExtensibilitySettingsTest.cs
/// <summary>
/// Project mock returns 2 Template instance, 1 with valid custom data, 1 with invalid custom data.
/// Verify that only 1 extension template is returned with correct details.
/// </summary>
Project mock returns 2 Template instance, 1 with valid custom data, 1 with invalid custom data.
Verify that only 1 extension template is returned with correct details.
Project mock returns 2 Template instance 1 with valid custom data 1 with invalid custom data . Verify that only 1 extension template is returned with correct details .
[TestMethod()]
        public void MyExtSettingsGetExtensionTemplatesOneResult()
        {
            MyExtensibilitySettings extSettings = new MyExtensibilitySettings("NotExistedPath");
            Mock<Project> projectMock = CreateProjectMock(PROJECTKIND_VB, CUSTOMDATASIGNATURE_VB, new Mock<Template>[] {
                Util.CreateTemplateMockSample1(),
                Util.CreateTemplateMockSample2()
            });
            List<MyExtensionTemplate> extensionTemplates = extSettings.GetExtensionTemplates(PROJECTKIND_VB, projectMock.Instance);
            Assert.IsTrue(1 == extensionTemplates.Count, "Found 1 extension template.");
            if (1 == extensionTemplates.Count)
            {
                MyExtensionTemplate extensionTemplate = extensionTemplates[0];
                Util.VerifyExtensionTemplateSample1(extensionTemplate);
            }
        }
[ TestMethod ( ) ] public void MyExtSettingsGetExtensionTemplatesOneResult ( ) { MyExtensibilitySettings extSettings = new MyExtensibilitySettings ( " " ) ; Mock < Project > projectMock = CreateProjectMock ( PROJECTKIND_VB , CUSTOMDATASIGNATURE_VB , new Mock < Template > [ ] { Util . CreateTemplateMockSample1 ( ) , Util . CreateTemplateMockSample2 ( ) } ) ; List < MyExtensionTemplate > extensionTemplates = extSettings . GetExtensionTemplates ( PROJECTKIND_VB , projectMock . Instance ) ; Assert . IsTrue ( 1 == extensionTemplates . Count , " " ) ; if ( 1 == extensionTemplates . Count ) { MyExtensionTemplate extensionTemplate = extensionTemplates [ 0 ] ; Util . VerifyExtensionTemplateSample1 ( extensionTemplate ) ; } }
Project mock returns 2 Template instance, 1 with valid custom data, 1 with invalid custom data.
Project mock returns 2 Template instance 1 with valid custom data 1 with invalid custom data .