src/Microsoft.VisualStudio.Editor.UnitTests/MyExtensibility/MyExtensibilitySettingsTest.cs
/// <summary>
/// Test to verify that setting assembly auto add / auto remove is case-insensitive.
/// Settings file is Pascal case. Parameters are random case.
/// </summary>
Test to verify that setting assembly auto add / auto remove is case-insensitive.
Settings file is Pascal case. Parameters are random case.
Test to verify that setting assembly auto add / auto remove is case - insensitive . Settings file is Pascal case . Parameters are random case .
[TestMethod()]
        public void MyExtSettingsSetAssemblyAutoAddAutoRemoveCaseInsensitive1()
        {
            string dirPath = System.Environment.CurrentDirectory;
            string filePath = Path.Combine(dirPath, ASM_SETTINGS_FILE_NAME);
            if (CreateFile(filePath, SETTINGSFILE1))
            {
                MyExtensibilitySettings extSettings = new MyExtensibilitySettings(dirPath);
                Mock<Project> projectMock = CreateProjectMock(PROJECTKIND_VB, CUSTOMDATASIGNATURE_VB,
                    new Mock<Template>[] { Util.CreateTemplateMockSample1(), Util.CreateTemplateMockSample2() });
                string vb9Name1 = "microsoft.VISUALBASIC.fx3.5Extensions, VERSION=8.0.0.0";
                extSettings.SetAssemblyAutoAdd(vb9Name1, false);
                string vb9Name2 = "MICROSOFT.VisualBasic.fx3.5extensions, VeRsIon=8.0.0.0";
                extSettings.SetAssemblyAutoRemove(vb9Name2, true);
                string speechName1 = "system.SPEECH, version=3.0.0.0, culture=NEUTRAL, publickeyTOKEN=31bf3856ad364e35";
                extSettings.SetAssemblyAutoAdd(speechName1, true);
                string speechName2 = "SyStEm.SpEeCh, VERSION=3.0.0.0, culture=ja-JP";
                extSettings.SetAssemblyAutoRemove(speechName2, false);
                bool settingsFileExist = File.Exists(filePath);
                Assert.IsTrue(settingsFileExist, "Settings file does not exists.");
                if (settingsFileExist)
                {
                    VerifyFile(filePath, SETTINGSFILE1_AFTER);
                    File.Delete(filePath);
                }
            }
            else
            {
                Assert.Fail("Could not create settings file.");
            }
        }
[ TestMethod ( ) ] public void MyExtSettingsSetAssemblyAutoAddAutoRemoveCaseInsensitive1 ( ) { string dirPath = System . Environment . CurrentDirectory ; string filePath = Path . Combine ( dirPath , ASM_SETTINGS_FILE_NAME ) ; if ( CreateFile ( filePath , SETTINGSFILE1 ) ) { MyExtensibilitySettings extSettings = new MyExtensibilitySettings ( dirPath ) ; Mock < Project > projectMock = CreateProjectMock ( PROJECTKIND_VB , CUSTOMDATASIGNATURE_VB , new Mock < Template > [ ] { Util . CreateTemplateMockSample1 ( ) , Util . CreateTemplateMockSample2 ( ) } ) ; string vb9Name1 = " " ; extSettings . SetAssemblyAutoAdd ( vb9Name1 , false ) ; string vb9Name2 = " " ; extSettings . SetAssemblyAutoRemove ( vb9Name2 , true ) ; string speechName1 = " " ; extSettings . SetAssemblyAutoAdd ( speechName1 , true ) ; string speechName2 = " " ; extSettings . SetAssemblyAutoRemove ( speechName2 , false ) ; bool settingsFileExist = File . Exists ( filePath ) ; Assert . IsTrue ( settingsFileExist , " " ) ; if ( settingsFileExist ) { VerifyFile ( filePath , SETTINGSFILE1_AFTER ) ; File . Delete ( filePath ) ; } } else { Assert . Fail ( " " ) ; } }
Test to verify that setting assembly auto add / auto remove is case-insensitive.
Test to verify that setting assembly auto add / auto remove is case - insensitive .