src/Microsoft.VisualStudio.Editor.UnitTests/MyExtensibility/MyExtensibilitySettingsTest.cs
/// <summary>
/// Test MyExtensionSettings.SetAssemblyAutoAdd/AutoRemove with valid assembly name
/// verify that a file is written out correctly.
/// </summary>
Test MyExtensionSettings.SetAssemblyAutoAdd/AutoRemove with valid assembly name
verify that a file is written out correctly.
Test MyExtensionSettings . SetAssemblyAutoAdd / AutoRemove with valid assembly name verify that a file is written out correctly .
[TestMethod()]
        public void MyExtSettingsSetAssemblyAutoAddAutoRemove()
        {
            string dirPath = Environment.CurrentDirectory;
            string filePath = Path.Combine(dirPath, ASM_SETTINGS_FILE_NAME);
            Mock<Project> projectMock = CreateProjectMock(PROJECTKIND_VB, CUSTOMDATASIGNATURE_VB, 
                new Mock<Template>[] { 
                    Util.CreateTemplateMockSample1(), 
                    Util.CreateTemplateMockSample2(), 
                    Util.CreateTemplateMockSample3()});
            MyExtensibilitySettings extSettings = new MyExtensibilitySettings(dirPath);
            extSettings.SetAssemblyAutoAdd(Util.ASMNAME_VBRUN9, true);
            extSettings.SetAssemblyAutoRemove(Util.ASMNAME_SYSTEM_SPEECH, false);
            bool settingsFileExist = File.Exists(filePath);
            Assert.IsTrue(settingsFileExist, "Settings file exists.");
            if (settingsFileExist)
            {
                VerifyFile(filePath, SETTINGSFILE1);
                File.Delete(filePath);
            }
        }
[ TestMethod ( ) ] public void MyExtSettingsSetAssemblyAutoAddAutoRemove ( ) { string dirPath = Environment . CurrentDirectory ; string filePath = Path . Combine ( dirPath , ASM_SETTINGS_FILE_NAME ) ; Mock < Project > projectMock = CreateProjectMock ( PROJECTKIND_VB , CUSTOMDATASIGNATURE_VB , new Mock < Template > [ ] { Util . CreateTemplateMockSample1 ( ) , Util . CreateTemplateMockSample2 ( ) , Util . CreateTemplateMockSample3 ( ) } ) ; MyExtensibilitySettings extSettings = new MyExtensibilitySettings ( dirPath ) ; extSettings . SetAssemblyAutoAdd ( Util . ASMNAME_VBRUN9 , true ) ; extSettings . SetAssemblyAutoRemove ( Util . ASMNAME_SYSTEM_SPEECH , false ) ; bool settingsFileExist = File . Exists ( filePath ) ; Assert . IsTrue ( settingsFileExist , " " ) ; if ( settingsFileExist ) { VerifyFile ( filePath , SETTINGSFILE1 ) ; File . Delete ( filePath ) ; } }
Test MyExtensionSettings.SetAssemblyAutoAdd/AutoRemove with valid assembly name
verify that a file is written out correctly.
Test MyExtensionSettings . SetAssemblyAutoAdd / AutoRemove with valid assembly name verify that a file is written out correctly .