public async Task Checks_Adding_Removing_Profiles() { var solutionFileName = Util.GetSampleProject("aspnetcore-empty-22", "aspnetcore-empty-22.sln"); solution = (Solution)await MonoDevelop.Projects.Services.ProjectService.ReadWorkspaceItem(Util.GetMonitor(), solutionFileName); var project = (DotNetProject)solution.GetAllProjects().Single(); var launchProfileProvider = new LaunchProfileProvider(project.BaseDirectory, project.DefaultNamespace); launchProfileProvider.LoadLaunchSettings(); Assert.That(launchProfileProvider.ProfilesObject, Is.Not.Null); Assert.That(launchProfileProvider.GlobalSettings, Is.Not.Empty); Assert.That(launchProfileProvider.Profiles, Has.Count.EqualTo(2)); launchProfileProvider.Profiles ["Test"] = new LaunchProfileData(); launchProfileProvider.SaveLaunchSettings(); launchProfileProvider = new LaunchProfileProvider(project.BaseDirectory, project.DefaultNamespace); launchProfileProvider.LoadLaunchSettings(); Assert.That(launchProfileProvider.Profiles, Has.Count.EqualTo(3)); }
public async Task Checks_Adding_Removing_Profiles() { var solutionFileName = Util.GetSampleProject("aspnetcore-empty-22", "aspnetcore-empty-22.sln"); solution = (Solution)await Services.ProjectService.ReadWorkspaceItem(Util.GetMonitor(), solutionFileName); var project = (DotNetProject)solution.GetAllProjects().Single(); var launchProfileProvider = new LaunchProfileProvider(project); launchProfileProvider.LoadLaunchSettings(); Assert.That(launchProfileProvider.ProfilesObject, Is.Not.Null); Assert.That(launchProfileProvider.GlobalSettings, Is.Not.Empty); var profiles = LaunchProfileData.DeserializeProfiles(launchProfileProvider.ProfilesObject); Assert.That(profiles, Has.Count.EqualTo(2)); profiles.Add("Test", new LaunchProfileData()); launchProfileProvider.SaveLaunchSettings(profiles.ToSerializableForm()); launchProfileProvider = new LaunchProfileProvider(project); launchProfileProvider.LoadLaunchSettings(); profiles = LaunchProfileData.DeserializeProfiles(launchProfileProvider.ProfilesObject); Assert.That(profiles, Has.Count.EqualTo(3)); }