public BaseRecipeRunner(Microsoft.Practices.RecipeFramework.GuidancePackage guidancePackage, string recipeName, BaseTest parentTest) { this.guidancePackage = guidancePackage; this.recipeName = recipeName; this.parentTest = parentTest; DirectoryInfo binDebugFolder = new DirectoryInfo(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)); DirectoryInfo solutionDir = binDebugFolder.Parent.Parent.Parent; testDataRootDir = Path.Combine(solutionDir.FullName, "TestData"); }
public void TestInitialize() { string configFileWhereSolutionNameIsStored = testContextInstance.TestDir + "\\Out\\testSolution.txt"; if (!File.Exists(configFileWhereSolutionNameIsStored)) { throw new Exception("File not found " + configFileWhereSolutionNameIsStored); } string solutionName = File.ReadAllText(configFileWhereSolutionNameIsStored).Trim(); solutionFile = @"SolutionTemplates\" + solutionName + @"\" + solutionName + ".sln"; testContextInstance.WriteLine("Using config value " + solutionName); coreRecipeGuidancePackage = GetGuidancePackage("SPALM.SPSF"); OpenSolution(solutionFile); }
public Microsoft.Practices.RecipeFramework.GuidancePackage InitGuidancePackage(string packageXmlFilename) { string basePath = Directory.GetParent(packageXmlFilename).FullName + "\\"; XmlReader configReader = XmlReader.Create(packageXmlFilename); //Microsoft.Practices.RecipeFramework.Configuration.GuidancePackage curentConfig = Microsoft.Practices.RecipeFramework.GuidancePackage.ReadConfiguration(configReader); //Microsoft.Practices.RecipeFramework.GuidancePackage curentGPckg = new Microsoft.Practices.RecipeFramework.GuidancePackage(curentConfig, basePath); Microsoft.Practices.RecipeFramework.GuidancePackage curentGPckg = new Microsoft.Practices.RecipeFramework.GuidancePackage(configReader); System.IServiceProvider sp = VsIdeTestHostContext.ServiceProvider; TypeResolutionService _trs = new TypeResolutionService(basePath); TestValueGatheringService _tvs = new TestValueGatheringService(); TestPersistenceService _tps = new TestPersistenceService(); DTE test = GetDTE(); testContextInstance.WriteLine("Mode: " + test.Mode); //curentGPckg.SetupTemporaryService(typeof(EnvDTE.DTE), GetDTE()); //curentGPckg.AddService(typeof(ITypeResolutionService), _trs); curentGPckg.AddService(typeof(EnvDTE.DTE), GetDTE()); curentGPckg.AddService(typeof(IValueGatheringService), _tvs); curentGPckg.AddService(typeof(IPersistenceService), _tps); //curentGPckg.AddService(typeof(Microsoft.VisualStudio.OLE.Interop.IOleComponentManager), sp.GetService(typeof(Microsoft.VisualStudio.OLE.Interop.IOleComponentManager))); curentGPckg.Site = new Microsoft.Practices.ComponentModel.Site(sp, new Microsoft.Practices.RecipeFramework.RecipeManager(), "SharePointSoftwareFactory"); //curentGPckg.Site = (en)sp.GetService(typeof(ISite)); configReader.Close(); testContextInstance.WriteLine("Site: " + curentGPckg.Site.GetType().ToString()); //testContextInstance.WriteLine("Container: " + curentGPckg.Site.Container.GetType().ToString()); //testContextInstance.WriteLine("Component: " + curentGPckg.Site.Component.GetType().ToString()); return(curentGPckg); }
public Microsoft.Practices.RecipeFramework.GuidancePackage InitGuidancePackage(string packageXmlFilename) { string basePath = Directory.GetParent(packageXmlFilename).FullName + "\\"; XmlReader configReader = XmlReader.Create(packageXmlFilename); //Microsoft.Practices.RecipeFramework.Configuration.GuidancePackage curentConfig = Microsoft.Practices.RecipeFramework.GuidancePackage.ReadConfiguration(configReader); //Microsoft.Practices.RecipeFramework.GuidancePackage curentGPckg = new Microsoft.Practices.RecipeFramework.GuidancePackage(curentConfig, basePath); Microsoft.Practices.RecipeFramework.GuidancePackage curentGPckg = new Microsoft.Practices.RecipeFramework.GuidancePackage(configReader); System.IServiceProvider sp = VsIdeTestHostContext.ServiceProvider; TypeResolutionService _trs = new TypeResolutionService(basePath); TestValueGatheringService _tvs = new TestValueGatheringService(); TestPersistenceService _tps = new TestPersistenceService(); DTE test = GetDTE(); testContextInstance.WriteLine("Mode: " + test.Mode); //curentGPckg.SetupTemporaryService(typeof(EnvDTE.DTE), GetDTE()); //curentGPckg.AddService(typeof(ITypeResolutionService), _trs); curentGPckg.AddService(typeof(EnvDTE.DTE), GetDTE()); curentGPckg.AddService(typeof(IValueGatheringService), _tvs); curentGPckg.AddService(typeof(IPersistenceService), _tps); //curentGPckg.AddService(typeof(Microsoft.VisualStudio.OLE.Interop.IOleComponentManager), sp.GetService(typeof(Microsoft.VisualStudio.OLE.Interop.IOleComponentManager))); curentGPckg.Site = new Microsoft.Practices.ComponentModel.Site(sp, new Microsoft.Practices.RecipeFramework.RecipeManager(), "SharePointSoftwareFactory"); //curentGPckg.Site = (en)sp.GetService(typeof(ISite)); configReader.Close(); testContextInstance.WriteLine("Site: " + curentGPckg.Site.GetType().ToString()); //testContextInstance.WriteLine("Container: " + curentGPckg.Site.Container.GetType().ToString()); //testContextInstance.WriteLine("Component: " + curentGPckg.Site.Component.GetType().ToString()); return curentGPckg; }
public LinqToSharePointTest(Microsoft.Practices.RecipeFramework.GuidancePackage guidancePackage, string recipeName, BaseTest parentTest) : base(guidancePackage, recipeName, parentTest) { }
public BaseWebFeatureRecipeRunner(Microsoft.Practices.RecipeFramework.GuidancePackage guidancePackage, string recipeName, BaseTest parentTest) : base(guidancePackage, recipeName, parentTest) { }