|
|
|
@ -2,7 +2,10 @@
@@ -2,7 +2,10 @@
|
|
|
|
|
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
|
|
|
|
|
|
|
|
|
|
using System; |
|
|
|
|
using ICSharpCode.Core; |
|
|
|
|
using ICSharpCode.SharpDevelop.Dom; |
|
|
|
|
using ICSharpCode.SharpDevelop.Project; |
|
|
|
|
using ICSharpCode.SharpDevelop.Workbench; |
|
|
|
|
using Microsoft.Build.Execution; |
|
|
|
|
using NUnit.Framework; |
|
|
|
|
using Rhino.Mocks; |
|
|
|
@ -12,19 +15,49 @@ namespace ICSharpCode.SharpDevelop
@@ -12,19 +15,49 @@ namespace ICSharpCode.SharpDevelop
|
|
|
|
|
[TestFixture] |
|
|
|
|
public class SolutionTests |
|
|
|
|
{ |
|
|
|
|
[Test, Ignore] |
|
|
|
|
public void UpdateMSBuildProperties_SolutionHasFileName_SolutionDefinesSolutionDirMSBuildPropertyWithDirectoryEndingInForwardSlash() |
|
|
|
|
ISolution CreateSolution() |
|
|
|
|
{ |
|
|
|
|
/*CreateSolution(); |
|
|
|
|
solution.FileName = @"d:\projects\MyProject\MySolution.sln"; |
|
|
|
|
|
|
|
|
|
solution.UpdateMSBuildProperties(); |
|
|
|
|
IFileService fileService = MockRepository.GenerateStub<IFileService>(); |
|
|
|
|
IProjectChangeWatcher changeWatcher = MockRepository.GenerateStrictMock<IProjectChangeWatcher>(); |
|
|
|
|
return new Solution(FileName.Create(@"d:\projects\MyProject\MySolution.sln"), changeWatcher, fileService); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Create a dummy project that can be added to a solution.
|
|
|
|
|
/// </summary>
|
|
|
|
|
IProject CreateProject(ISolution parentSolution) |
|
|
|
|
{ |
|
|
|
|
var project = MockRepository.GenerateStrictMock<IProject>(); |
|
|
|
|
project.Stub(p => p.ParentSolution).Return(parentSolution); |
|
|
|
|
project.Stub(p => p.ParentFolder).PropertyBehavior(); |
|
|
|
|
project.Stub(p => p.ProjectSections).Return(new SimpleModelCollection<SolutionSection>()); |
|
|
|
|
project.Stub(p => p.ConfigurationMapping).Return(new ConfigurationMapping()); |
|
|
|
|
project.Stub(p => p.IsStartable).Return(false); |
|
|
|
|
return project; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
[Test] |
|
|
|
|
public void UpdateMSBuildProperties_SolutionHasFileName_SolutionDefinesSolutionDirMSBuildPropertyWithDirectoryEndingInSlash() |
|
|
|
|
{ |
|
|
|
|
var solution = CreateSolution(); |
|
|
|
|
|
|
|
|
|
ProjectPropertyInstance property = solution.MSBuildProjectCollection.GetGlobalProperty("SolutionDir"); |
|
|
|
|
string solutionDir = property.EvaluatedValue; |
|
|
|
|
|
|
|
|
|
string expectedSolutionDir = @"d:\projects\MyProject\"; |
|
|
|
|
Assert.AreEqual(expectedSolutionDir, solutionDir);*/ |
|
|
|
|
Assert.AreEqual(expectedSolutionDir, solutionDir); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
[Test] |
|
|
|
|
public void AddProjectToDisconnectedFolder() |
|
|
|
|
{ |
|
|
|
|
var solution = CreateSolution(); |
|
|
|
|
var folder = solution.CreateFolder("folder"); |
|
|
|
|
solution.Items.Remove(folder); |
|
|
|
|
|
|
|
|
|
var project = CreateProject(solution); |
|
|
|
|
folder.Items.Add(project); |
|
|
|
|
Assert.IsEmpty(solution.Projects); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|