src/Microsoft.VisualStudio.Editor.UnitTests/MyExtensibility/MyExtensibilitySettingsTest.cs
/// <summary>
/// MyExtEditCustomDataXml - Scenario 1 - 1: File contains garbage (random bits).
/// If the file is a binary file, VSCore's LoadTextFile method (textfile.cpp) will return an error
/// and the custom data field will be NULL.
/// </summary>
Scenario 1 - 1: File contains garbage (random bits).
If the file is a binary file, VSCore's LoadTextFile method (textfile.cpp) will return an error
and the custom data field will be NULL.
Scenario 1 - 1 : File contains garbage ( random bits ) . If the file is a binary file VSCore ' s LoadTextFile method ( textfile . cpp ) will return an error and the custom data field will be NULL .
[TestMethod()]
        public void MyExtEditCustomDataXmlScenario1_1()
        {
            Mock<Template> templateWithBinaryCustomDataMock = Util.CreateTemplateMock(
                "MyExtEditCustomDataXMLScenario1Binary",
                "A template with a binary .customdata file will has CustomData field as Nothing.",
                "C:\\Program Files\\Microsoft Visual Studio 11.0\\Common7\\Ide\\ItemTemplatesCache\\VisualBasic\\1033\\MyExtEditCustomDataXmlScenario1.zip\\MyExtEditCustomDataXmlScenario1.vstemplate",
                "MyExtEditCustomDataXmlScenario1.vb",
                null);
            Mock<Project> projectMock = CreateProjectMock(PROJECTKIND_VB, CUSTOMDATASIGNATURE_VB,
                new Mock<Template>[] { templateWithBinaryCustomDataMock });
            MyExtensibilitySettings extSettings = new MyExtensibilitySettings("NotExistedPath");
            List<MyExtensionTemplate> extensionTemplates = extSettings.GetExtensionTemplates(PROJECTKIND_VB, projectMock.Instance);
            Assert.IsNull(extensionTemplates, "Should not get any extension templates!");
        }
[ TestMethod ( ) ] public void MyExtEditCustomDataXmlScenario1_1 ( ) { Mock < Template > templateWithBinaryCustomDataMock = Util . CreateTemplateMock ( " " , " " , " \\ \\ \\ \\ \\ \\ \\ \\ \\ " , " " , null ) ; Mock < Project > projectMock = CreateProjectMock ( PROJECTKIND_VB , CUSTOMDATASIGNATURE_VB , new Mock < Template > [ ] { templateWithBinaryCustomDataMock } ) ; MyExtensibilitySettings extSettings = new MyExtensibilitySettings ( " " ) ; List < MyExtensionTemplate > extensionTemplates = extSettings . GetExtensionTemplates ( PROJECTKIND_VB , projectMock . Instance ) ; Assert . IsNull ( extensionTemplates , " " ) ; }
MyExtEditCustomDataXml - Scenario 1 - 1: File contains garbage (random bits).
MyExtEditCustomDataXml - Scenario 1 - 1 : File contains garbage ( random bits ) .