コード例 #1
0
        public string Disable()
        {
            using (RegistryKey key = OpenMvc2Key())
                key.DeleteSubKeyTree("xUnit.net");

            UninstallZipFiles(VisualStudio2010.GetTestProjectTemplatePath("CSharp"));
            UninstallZipFiles(VisualStudio2010.GetTestProjectTemplatePath("VisualBasic"));

            return(null);
        }
コード例 #2
0
        public string Enable()
        {
            string CSharpPath = VisualStudio2010.GetTestProjectTemplatePath("CSharp");

            if (!Directory.Exists(CSharpPath))
            {
                Directory.CreateDirectory(CSharpPath);
            }

            ResourceHelper.WriteResourceToFile("Xunit.Installer.Templates.MVC2-CS-VS2010.zip",
                                               Path.Combine(CSharpPath, TEMPLATE_NAME_CSHARP));

            string VBPath = VisualStudio2010.GetTestProjectTemplatePath("VisualBasic");

            if (!Directory.Exists(VBPath))
            {
                Directory.CreateDirectory(VBPath);
            }

            ResourceHelper.WriteResourceToFile("Xunit.Installer.Templates.MVC2-VB-VS2010.zip",
                                               Path.Combine(VBPath, TEMPLATE_NAME_VB));

            using (RegistryKey key = OpenMvc2Key())
                using (RegistryKey templateKey = key.CreateSubKey("xUnit.net"))
                {
                    using (RegistryKey csharpKey = templateKey.CreateSubKey("C#"))
                    {
                        csharpKey.SetValue("AdditionalInfo", "http://xunit.codeplex.com/");
                        csharpKey.SetValue("Package", "");
                        csharpKey.SetValue("Path", @"CSharp\Test");
                        csharpKey.SetValue("Template", TEMPLATE_NAME_CSHARP);
                        csharpKey.SetValue("TestFrameworkName", "xUnit.net build " + Assembly.GetExecutingAssembly().GetName().Version);
                    }
                    using (RegistryKey vbKey = templateKey.CreateSubKey("VB"))
                    {
                        vbKey.SetValue("AdditionalInfo", "http://xunit.codeplex.com/");
                        vbKey.SetValue("Package", "");
                        vbKey.SetValue("Path", @"VisualBasic\Test");
                        vbKey.SetValue("Template", TEMPLATE_NAME_VB);
                        vbKey.SetValue("TestFrameworkName", "xUnit.net build " + Assembly.GetExecutingAssembly().GetName().Version);
                    }
                }

            return(null);
        }