src/Microsoft.VisualStudio.Editor.UnitTests/MyExtensibility/MyExtensibilitySettingsTest.cs
/// <summary>
/// Test GetExtensiontTemplates case insensitive. 
/// Template custom data is random case. Assembly parameter name is Pascal case.
/// </summary>
Test GetExtensiontTemplates case insensitive.
Template custom data is random case. Assembly parameter name is Pascal case.
Test GetExtensiontTemplates case insensitive . Template custom data is random case . Assembly parameter name is Pascal case .
[TestMethod()]
        public void MyExtSettingsGetExtensionTemplatesCaseInsensitive2()
        {
            MyExtensibilitySettings extSettings = new MyExtensibilitySettings("NotExistedPath");
            Mock<Project> projectMock = CreateProjectMock(PROJECTKIND_VB, CUSTOMDATASIGNATURE_VB, new Mock<Template>[] {
                Util.CreateTemplateMockSample1CaseInsensitive(),
                Util.CreateTemplateMockSample3CaseInsensitive()
            });
            List<MyExtensionTemplate> extensionTemplates = extSettings.GetExtensionTemplates(
                PROJECTKIND_VB, projectMock.Instance, Util.ASMNAME_VBRUN9);
            if (null != extensionTemplates)
            {
                if (1 == extensionTemplates.Count)
                {
                    Util.VerifyExtensionTemplateSample1CaseInsensitive(extensionTemplates[0]);
                }
                else
                {
                    Assert.Fail(string.Format(
                        "Expect 1 extension for {0}. Result is {1}.",
                        Util.ASMNAME_VBRUN9, extensionTemplates.Count));
                }
            }
            else
            {
                Assert.Fail("GetExtensionTemplates return null for " + Util.ASMNAME_VBRUN9);
            }
            extensionTemplates = extSettings.GetExtensionTemplates(
                PROJECTKIND_VB, projectMock.Instance, Util.ASMNAME_SYSTEM_SPEECH);
            if (null != extensionTemplates)
            {
                if (1 == extensionTemplates.Count)
                {
                    Util.VerifyExtensionTemplateSample3CaseInsensitive(extensionTemplates[0]);
                }
                else
                {
                    Assert.Fail(string.Format(
                        "Expect 1 extension for {0}. Result is {1}.",
                        Util.ASMNAME_SYSTEM_SPEECH, extensionTemplates.Count));
                }
            }
            else
            {
                Assert.Fail("GetExtensionTemplates return null for " + Util.ASMNAME_SYSTEM_SPEECH);
            }
        }
[ TestMethod ( ) ] public void MyExtSettingsGetExtensionTemplatesCaseInsensitive2 ( ) { MyExtensibilitySettings extSettings = new MyExtensibilitySettings ( " " ) ; Mock < Project > projectMock = CreateProjectMock ( PROJECTKIND_VB , CUSTOMDATASIGNATURE_VB , new Mock < Template > [ ] { Util . CreateTemplateMockSample1CaseInsensitive ( ) , Util . CreateTemplateMockSample3CaseInsensitive ( ) } ) ; List < MyExtensionTemplate > extensionTemplates = extSettings . GetExtensionTemplates ( PROJECTKIND_VB , projectMock . Instance , Util . ASMNAME_VBRUN9 ) ; if ( null != extensionTemplates ) { if ( 1 == extensionTemplates . Count ) { Util . VerifyExtensionTemplateSample1CaseInsensitive ( extensionTemplates [ 0 ] ) ; } else { Assert . Fail ( string . Format ( " " , Util . ASMNAME_VBRUN9 , extensionTemplates . Count ) ) ; } } else { Assert . Fail ( " " + Util . ASMNAME_VBRUN9 ) ; } extensionTemplates = extSettings . GetExtensionTemplates ( PROJECTKIND_VB , projectMock . Instance , Util . ASMNAME_SYSTEM_SPEECH ) ; if ( null != extensionTemplates ) { if ( 1 == extensionTemplates . Count ) { Util . VerifyExtensionTemplateSample3CaseInsensitive ( extensionTemplates [ 0 ] ) ; } else { Assert . Fail ( string . Format ( " " , Util . ASMNAME_SYSTEM_SPEECH , extensionTemplates . Count ) ) ; } } else { Assert . Fail ( " " + Util . ASMNAME_SYSTEM_SPEECH ) ; } }
Test GetExtensiontTemplates case insensitive.
Test GetExtensiontTemplates case insensitive .