public void Save_SaveFilledConfiguration() { //Arrange var currentPath = System.AppDomain.CurrentDomain.BaseDirectory; var pathForConfig = Path.Combine(currentPath, "ProjectConfiguration\\TestData\\projectConfig.xml"); File.Delete(pathForConfig); var projectConfiguration = new ProjectConfiguraiton { LastSavedSearch = new Dictionary <string, List <ItemSearch.PropertyInfo> > { { "Method", new List <ItemSearch.PropertyInfo> { new PropertyInfo() { PropertyName = "name", PropertyValue = "mso*" } } } }, LastSelectedDir = @"C:\", LastSelectedMfFile = @"C:\file.mf", UseVSFormatting = true, MethodInfos = new List <MethodInfo> { new MethodInfo { EventData = MethodPlugin.Code.EventSpecificData.None, ExecutionAllowedToId = "A73B655731924CD0B027E4F4D5FCC0A9", ExecutionAllowedToKeyedName = "World", InnovatorMethodConfigId = "6D5D2A114135409D82561DC1C422C87F", InnovatorMethodId = "6B6E21E655CA4A1093FB9E970463F061", MethodComment = "", MethodLanguage = "C#", MethodName = "Method1", MethodType = "server", PackageName = "MSO_Standard", PartialClasses = new List <string> { @"TestPartial\Partials\GetLicenseInfo" }, TemplateName = "CSharp" } } }; //Act projectConfigurationManager.Save(pathForConfig, projectConfiguration); //Assert Assert.That(File.ReadAllText(pathForConfig), Is.EqualTo(File.ReadAllText(Path.Combine(currentPath, "ProjectConfiguration\\TestData\\ExpectedFilledConfig.txt"))).NoClip); }
public void Setup() { this.dialogFactory = Substitute.For <IDialogFactory>(); this.serviceProvider = Substitute.For <IVisualStudioServiceProvider>(); this.iOWrapper = Substitute.For <IIOWrapper>(); this.iOWrapper.PathIsPathRooted(methodsFolderPath).Returns(true); this.vsPackageWrapper = Substitute.For <IVsPackageWrapper>(); this.messageManager = Substitute.For <MessageManager>(); this.projectConfigurationManager = Substitute.For <IProjectConfigurationManager>(); this.projectManager = new ProjectManager(serviceProvider, iOWrapper, vsPackageWrapper, messageManager, projectConfigurationManager); IProjectConfiguraiton projectConfiguraiton = new ProjectConfiguraiton(); projectConfiguraiton.MethodsFolderPath = methodsFolderPath; projectConfigurationManager.CurrentProjectConfiguraiton.Returns(projectConfiguraiton); }