Browse Source

Port most of SharpDevelop to new ISolution API.

pull/32/merge
Daniel Grunwald 13 years ago
parent
commit
5ac93c1540
  1. 24
      SharpDevelop.Tests.sln
  2. 2
      src/AddIns/Analysis/CodeCoverage/Test/Coverage/OpenCoverSettingsTestFixture.cs
  3. 4
      src/AddIns/Analysis/CodeCoverage/Test/Coverage/SolutionCodeCoverageResultsTests.cs
  4. 20
      src/AddIns/Analysis/UnitTesting/Test/NUnit/NUnitConsoleExeSelectedTestFixture.cs
  5. 2
      src/AddIns/Analysis/UnitTesting/Test/Utils/MockCSharpProject.cs
  6. 1
      src/AddIns/BackendBindings/AspNet.Mvc/Test/AspNet.Mvc.Tests.csproj
  7. 20
      src/AddIns/BackendBindings/AspNet.Mvc/Test/Helpers/FakeSolution.cs
  8. 2
      src/AddIns/BackendBindings/AspNet.Mvc/Test/Helpers/MSBuildProjectHelper.cs
  9. 3
      src/AddIns/BackendBindings/AspNet.Mvc/Test/Helpers/TestableProject.cs
  10. 1
      src/AddIns/BackendBindings/CSharpBinding/Project/CSharpBinding.addin
  11. 10
      src/AddIns/BackendBindings/CSharpBinding/Project/Src/Project/CSharpProject.cs
  12. 1
      src/AddIns/BackendBindings/CppBinding/CppBinding/CppBinding.addin
  13. 7
      src/AddIns/BackendBindings/CppBinding/CppBinding/Project/ApplicationOptions.cs
  14. 8
      src/AddIns/BackendBindings/CppBinding/CppBinding/Project/CppProject.cs
  15. 5
      src/AddIns/BackendBindings/CppBinding/CppBinding/Project/LinkerOptions.xaml.cs
  16. 6
      src/AddIns/BackendBindings/CppBinding/CppBinding/Project/PreprocessorOptions.xaml.cs
  17. 2
      src/AddIns/BackendBindings/CppBinding/CppBinding/Project/SpecifyCliRuntimeLibraryCommand.cs
  18. 1
      src/AddIns/BackendBindings/FSharpBinding/FSharpBinding.addin
  19. 1
      src/AddIns/BackendBindings/Scripting/Test/ICSharpCode.Scripting.Tests.csproj
  20. 340
      src/AddIns/BackendBindings/Scripting/Test/Utils/MockProject.cs
  21. 1
      src/AddIns/BackendBindings/WixBinding/Project/WixBinding.addin
  22. 4
      src/AddIns/BackendBindings/WixBinding/Test/DialogLoading/BitmapFromProjectTestFixture.cs
  23. 2
      src/AddIns/BackendBindings/WixBinding/Test/DialogLoading/BitmapTestFixture.cs
  24. 2
      src/AddIns/BackendBindings/WixBinding/Test/DialogLoading/InvalidLocationTests.cs
  25. 2
      src/AddIns/BackendBindings/WixBinding/Test/DialogLoading/InvalidSizeTests.cs
  26. 2
      src/AddIns/BackendBindings/WixBinding/Test/DialogLoading/MissingBitmapBinaryTestFixture.cs
  27. 2
      src/AddIns/BackendBindings/WixBinding/Test/DialogLoading/NullComponentCreatorTestFixture.cs
  28. 3
      src/AddIns/BackendBindings/WixBinding/Test/Document/ChildDirectoriesTestFixture.cs
  29. 3
      src/AddIns/BackendBindings/WixBinding/Test/Document/DirectoryNameTests.cs
  30. 4
      src/AddIns/BackendBindings/WixBinding/Test/Document/DuplicateBinaryIdTestFixture.cs
  31. 4
      src/AddIns/BackendBindings/WixBinding/Test/Document/GetBinaryFileNameFromProjectTestFixture.cs
  32. 4
      src/AddIns/BackendBindings/WixBinding/Test/Document/GetBinaryFileNameFromVariablesTestFixture.cs
  33. 4
      src/AddIns/BackendBindings/WixBinding/Test/Document/GetBinaryFileNameTestFixture.cs
  34. 5
      src/AddIns/BackendBindings/WixBinding/Test/Document/WixDocumentSaveTests.cs
  35. 3
      src/AddIns/BackendBindings/WixBinding/Test/Gui/AddWixProjectNodeTestFixture.cs
  36. 8
      src/AddIns/BackendBindings/WixBinding/Test/Gui/DeleteWixExtensionNodeTestFixture.cs
  37. 12
      src/AddIns/BackendBindings/WixBinding/Test/Gui/DeleteWixLibraryNodeTestFixture.cs
  38. 3
      src/AddIns/BackendBindings/WixBinding/Test/Gui/ShowExistingPackageFilesViewTestFixture.cs
  39. 4
      src/AddIns/BackendBindings/WixBinding/Test/Gui/ShowSetupFilesTestFixture.cs
  40. 4
      src/AddIns/BackendBindings/WixBinding/Test/Gui/WixDocumentEditorReplaceElementTestFixture.cs
  41. 4
      src/AddIns/BackendBindings/WixBinding/Test/Gui/WixDocumentWindowIsActiveTests.cs
  42. 4
      src/AddIns/BackendBindings/WixBinding/Test/Gui/WixProjectWithLibraryItemsTestFixture.cs
  43. 4
      src/AddIns/BackendBindings/WixBinding/Test/Gui/WixProjectWithUnexpandedLibraryItemsTestFixture.cs
  44. 4
      src/AddIns/BackendBindings/WixBinding/Test/Gui/WixProjectWithWixExtensionItemsTestFixture.cs
  45. 2
      src/AddIns/BackendBindings/WixBinding/Test/PackageFiles/ActivePackageFilesViewTests.cs
  46. 2
      src/AddIns/BackendBindings/WixBinding/Test/PackageFiles/ActiveViewChangedWhenPackageFilesOpenTestFixtureBase.cs
  47. 2
      src/AddIns/BackendBindings/WixBinding/Test/PackageFiles/AllowedChildElementsTestFixture.cs
  48. 2
      src/AddIns/BackendBindings/WixBinding/Test/PackageFiles/FileIdGenerationTests.cs
  49. 2
      src/AddIns/BackendBindings/WixBinding/Test/PackageFiles/NoWixSourceFileInProjectTestFixture.cs
  50. 2
      src/AddIns/BackendBindings/WixBinding/Test/PackageFiles/OpenTextEditorsTestFixture.cs
  51. 2
      src/AddIns/BackendBindings/WixBinding/Test/PackageFiles/PackageFilesTestFixtureBase.cs
  52. 2
      src/AddIns/BackendBindings/WixBinding/Test/PackageFiles/PackageFilesViewIsActiveTests.cs
  53. 2
      src/AddIns/BackendBindings/WixBinding/Test/PackageFiles/PackageFilesViewTestFixture.cs
  54. 2
      src/AddIns/BackendBindings/WixBinding/Test/PackageFiles/SingleWixSourceFileInProjectTestFixture.cs
  55. 2
      src/AddIns/BackendBindings/WixBinding/Test/PackageFiles/TargetDirectoryRefTestFixture.cs
  56. 2
      src/AddIns/BackendBindings/WixBinding/Test/PackageFiles/TwoWixSourceFilesInProjectTestFixture.cs
  57. 2
      src/AddIns/BackendBindings/WixBinding/Test/PackageFiles/TwoWixSourceFilesWithErrorsTestFixture.cs
  58. 2
      src/AddIns/BackendBindings/WixBinding/Test/PackageFiles/UpdateRootDirectoryWithNewFilesTestFixtureBase.cs
  59. 2
      src/AddIns/BackendBindings/WixBinding/Test/PackageFiles/WixSourceFileWithErrorsIgnoredTestFixture.cs
  60. 2
      src/AddIns/BackendBindings/WixBinding/Test/Project/AddWixExtensionTestFixture.cs
  61. 2
      src/AddIns/BackendBindings/WixBinding/Test/Project/AddWixLibraryTestFixture.cs
  62. 2
      src/AddIns/BackendBindings/WixBinding/Test/Project/CanCompileTests.cs
  63. 2
      src/AddIns/BackendBindings/WixBinding/Test/Project/CloneWixLibraryTests.cs
  64. 6
      src/AddIns/BackendBindings/WixBinding/Test/Project/CreateNewWixProjectObjectTestFixture.cs
  65. 2
      src/AddIns/BackendBindings/WixBinding/Test/Project/CreateWixProjectItemTests.cs
  66. 2
      src/AddIns/BackendBindings/WixBinding/Test/Project/GetPreprocessorVariableValueTests.cs
  67. 2
      src/AddIns/BackendBindings/WixBinding/Test/Project/GetWixExtensionsTestFixture.cs
  68. 2
      src/AddIns/BackendBindings/WixBinding/Test/Project/GetWixFileProjectItemsTestFixture.cs
  69. 2
      src/AddIns/BackendBindings/WixBinding/Test/Project/GetWixSourceFileProjectItemsTestFixture.cs
  70. 6
      src/AddIns/BackendBindings/WixBinding/Test/Project/WixBuilderCannotBuildNonWixProjectTestFixture.cs
  71. 2
      src/AddIns/BackendBindings/WixBinding/Test/Project/WixInstallerPathTests.cs
  72. 2
      src/AddIns/BackendBindings/WixBinding/Test/Project/WixNodeBuilderCanBuildWixProjectTestFixture.cs
  73. 2
      src/AddIns/BackendBindings/WixBinding/Test/Project/WixProjectTests.cs
  74. 3
      src/AddIns/BackendBindings/WixBinding/Test/Utils/MessageLoopHelper.cs
  75. 28
      src/AddIns/BackendBindings/WixBinding/Test/Utils/MockSolution.cs
  76. 1
      src/AddIns/BackendBindings/WixBinding/Test/Utils/ResourceServiceHelper.cs
  77. 2
      src/AddIns/BackendBindings/WixBinding/Test/Utils/Tests/MockFormsDesignerViewTests.cs
  78. 2
      src/AddIns/BackendBindings/WixBinding/Test/Utils/Tests/MockPackageFilesViewFactoryTests.cs
  79. 2
      src/AddIns/BackendBindings/WixBinding/Test/Utils/Tests/MockTextEditorViewContentTests.cs
  80. 2
      src/AddIns/BackendBindings/WixBinding/Test/Utils/Tests/MockViewContentTests.cs
  81. 2
      src/AddIns/BackendBindings/WixBinding/Test/Utils/Tests/MockWixPackageFilesControlTests.cs
  82. 2
      src/AddIns/BackendBindings/WixBinding/Test/Utils/Tests/MockWorkbenchTests.cs
  83. 2
      src/AddIns/BackendBindings/WixBinding/Test/Utils/Tests/WixBindingTestsHelperTests.cs
  84. 5
      src/AddIns/BackendBindings/WixBinding/Test/Utils/WixBindingTestsHelper.cs
  85. 1
      src/AddIns/BackendBindings/WixBinding/Test/WixBinding.Tests.csproj
  86. 4
      src/AddIns/BackendBindings/XamlBinding/XamlBinding/XamlSymbolSearch.cs
  87. 4
      src/AddIns/Debugger/Debugger.AddIn/Pads/WatchPad.cs
  88. 5
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign.AddIn/Src/AbstractEventHandlerService.cs
  89. 5
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign.AddIn/Src/MyTypeFinder.cs
  90. 8
      src/AddIns/Misc/PackageManagement/Project/Src/EnvDTE/SolutionConfiguration.cs
  91. 5
      src/AddIns/Misc/PackageManagement/Project/Src/MSBuildBasedProjectExtensions.cs
  92. 1
      src/AddIns/Misc/PackageManagement/Test/PackageManagement.Tests.csproj
  93. 30
      src/AddIns/Misc/PackageManagement/Test/Src/Helpers/ProjectHelper.cs
  94. 6
      src/AddIns/Misc/PackageManagement/Test/Src/PackageManagementSelectedProjectsTests.cs
  95. 10
      src/AddIns/Misc/PackageManagement/Test/Src/PackageManagementSolutionTests.cs
  96. 17
      src/AddIns/Misc/PackageManagement/Test/Src/Scripting/PackageManagementConsoleViewModelTests.cs
  97. 6
      src/AddIns/Misc/PackageManagement/Test/Src/Scripting/PowerShellWorkingDirectoryTests.cs
  98. 8
      src/AddIns/Misc/PackageManagement/Test/Src/SelectedProjectsForInstalledPackagesTests.cs
  99. 8
      src/AddIns/Misc/PackageManagement/Test/Src/SelectedProjectsForUpdatedPackagesTests.cs
  100. 5
      src/AddIns/Misc/PackageManagement/Test/Src/SharpDevelopPackageManagerFactoryTests.cs
  101. Some files were not shown because too many files have changed in this diff Show More

24
SharpDevelop.Tests.sln

@ -1,7 +1,7 @@ @@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
# SharpDevelop 4.3
# SharpDevelop 5.0
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Main", "Main", "{256F5C28-532C-44C0-8AB8-D8EC5E492E01}"
ProjectSection(SolutionItems) = postProject
EndProjectSection
@ -133,12 +133,12 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "PackageManagement", "Packag @@ -133,12 +133,12 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "PackageManagement", "Packag
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PackageManagement", "src\AddIns\Misc\PackageManagement\Project\PackageManagement.csproj", "{AE4AB0FA-6087-4480-AF37-0FA1452B3DA1}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PackageManagement.Tests", "src\AddIns\Misc\PackageManagement\Test\PackageManagement.Tests.csproj", "{56E98A01-8398-4A08-9578-C7337711A52B}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PackageManagement.PowerShell", "src\AddIns\Misc\PackageManagement\PowerShell\Project\PackageManagement.PowerShell.csproj", "{A406803B-C584-43A3-BCEE-A0BB3132CB5F}"
EndProject
Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "SharpDevelop.EnvDTE", "src\AddIns\Misc\PackageManagement\SharpDevelop.EnvDTE\SharpDevelop.EnvDTE.vbproj", "C3F15E22-5793-4129-AF8C-6229112B86D2"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PackageManagement.Tests", "src\AddIns\Misc\PackageManagement\Test\PackageManagement.Tests.csproj", "{56E98A01-8398-4A08-9578-C7337711A52B}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Display Bindings", "Display Bindings", "{11BF9245-88A3-4A0A-9A8A-EC9D98036B0F}"
ProjectSection(SolutionItems) = postProject
EndProjectSection
@ -791,14 +791,6 @@ Global @@ -791,14 +791,6 @@ Global
{AE4AB0FA-6087-4480-AF37-0FA1452B3DA1}.Release|Any CPU.ActiveCfg = Release|x86
{AE4AB0FA-6087-4480-AF37-0FA1452B3DA1}.Release|x86.Build.0 = Release|x86
{AE4AB0FA-6087-4480-AF37-0FA1452B3DA1}.Release|x86.ActiveCfg = Release|x86
{56E98A01-8398-4A08-9578-C7337711A52B}.Debug|Any CPU.Build.0 = Debug|x86
{56E98A01-8398-4A08-9578-C7337711A52B}.Debug|Any CPU.ActiveCfg = Debug|x86
{56E98A01-8398-4A08-9578-C7337711A52B}.Debug|x86.Build.0 = Debug|x86
{56E98A01-8398-4A08-9578-C7337711A52B}.Debug|x86.ActiveCfg = Debug|x86
{56E98A01-8398-4A08-9578-C7337711A52B}.Release|Any CPU.Build.0 = Release|x86
{56E98A01-8398-4A08-9578-C7337711A52B}.Release|Any CPU.ActiveCfg = Release|x86
{56E98A01-8398-4A08-9578-C7337711A52B}.Release|x86.Build.0 = Release|x86
{56E98A01-8398-4A08-9578-C7337711A52B}.Release|x86.ActiveCfg = Release|x86
{A5C0E8F8-9D04-46ED-91D6-1DEF1575313B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A5C0E8F8-9D04-46ED-91D6-1DEF1575313B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A5C0E8F8-9D04-46ED-91D6-1DEF1575313B}.Debug|x86.Build.0 = Debug|Any CPU
@ -847,6 +839,14 @@ Global @@ -847,6 +839,14 @@ Global
{85C09AD8-183B-403A-869A-7226646218A9}.Release|Any CPU.ActiveCfg = Release|x86
{85C09AD8-183B-403A-869A-7226646218A9}.Release|x86.Build.0 = Release|x86
{85C09AD8-183B-403A-869A-7226646218A9}.Release|x86.ActiveCfg = Release|x86
{56E98A01-8398-4A08-9578-C7337711A52B}.Debug|Any CPU.Build.0 = Debug|x86
{56E98A01-8398-4A08-9578-C7337711A52B}.Debug|Any CPU.ActiveCfg = Debug|x86
{56E98A01-8398-4A08-9578-C7337711A52B}.Debug|x86.Build.0 = Debug|x86
{56E98A01-8398-4A08-9578-C7337711A52B}.Debug|x86.ActiveCfg = Debug|x86
{56E98A01-8398-4A08-9578-C7337711A52B}.Release|Any CPU.Build.0 = Release|x86
{56E98A01-8398-4A08-9578-C7337711A52B}.Release|Any CPU.ActiveCfg = Release|x86
{56E98A01-8398-4A08-9578-C7337711A52B}.Release|x86.Build.0 = Release|x86
{56E98A01-8398-4A08-9578-C7337711A52B}.Release|x86.ActiveCfg = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@ -909,9 +909,9 @@ Global @@ -909,9 +909,9 @@ Global
{6B1CFE35-DA17-4DEB-9C6E-227E5E251DA0} = {DEFC8584-BEC3-4921-BD0F-40482E450B7B}
{0008FCE9-9EB4-4E2E-979B-553278E5BBA6} = {DEFC8584-BEC3-4921-BD0F-40482E450B7B}
{AE4AB0FA-6087-4480-AF37-0FA1452B3DA1} = {485A4CCF-55CF-49F4-BD6D-A22B788C67DA}
{56E98A01-8398-4A08-9578-C7337711A52B} = {485A4CCF-55CF-49F4-BD6D-A22B788C67DA}
{A406803B-C584-43A3-BCEE-A0BB3132CB5F} = {485A4CCF-55CF-49F4-BD6D-A22B788C67DA}
C3F15E22-5793-4129-AF8C-6229112B86D2 = {485A4CCF-55CF-49F4-BD6D-A22B788C67DA}
{56E98A01-8398-4A08-9578-C7337711A52B} = {485A4CCF-55CF-49F4-BD6D-A22B788C67DA}
{0162E499-42D0-409B-AA25-EED21F75336B} = {11BF9245-88A3-4A0A-9A8A-EC9D98036B0F}
{E618A9CD-A39F-4925-A538-E8A3FEF24E54} = {11BF9245-88A3-4A0A-9A8A-EC9D98036B0F}
{DCA2703D-250A-463E-A68A-07ED105AE6BD} = {11BF9245-88A3-4A0A-9A8A-EC9D98036B0F}

2
src/AddIns/Analysis/CodeCoverage/Test/Coverage/OpenCoverSettingsTestFixture.cs

@ -62,7 +62,7 @@ namespace ICSharpCode.CodeCoverage.Tests.Coverage @@ -62,7 +62,7 @@ namespace ICSharpCode.CodeCoverage.Tests.Coverage
{
MSBuildBasedProject project = new MSBuildBasedProject(
new ProjectCreateInformation {
Solution = new Solution(new MockProjectChangeWatcher()),
Solution = MockSolution.Create(),
OutputProjectFileName = new FileName(@"C:\temp\test.csproj"),
ProjectName = "test"
});

4
src/AddIns/Analysis/CodeCoverage/Test/Coverage/SolutionCodeCoverageResultsTests.cs

@ -25,7 +25,7 @@ namespace ICSharpCode.CodeCoverage.Tests.Coverage @@ -25,7 +25,7 @@ namespace ICSharpCode.CodeCoverage.Tests.Coverage
void CreateSolutionCodeCoverageResults()
{
solution = new Solution(new MockProjectChangeWatcher());
solution = MockSolution.Create();
fakeFileSystem = MockRepository.GenerateStub<IFileSystem>();
solutionCodeCoverageResults = new SolutionCodeCoverageResults(solution, fakeFileSystem);
}
@ -39,7 +39,7 @@ namespace ICSharpCode.CodeCoverage.Tests.Coverage @@ -39,7 +39,7 @@ namespace ICSharpCode.CodeCoverage.Tests.Coverage
{
var project = new MockCSharpProject(solution, Path.GetFileNameWithoutExtension(fileName));
project.FileName = new FileName(fileName);
solution.Folders.Add(project);
((ICollection<IProject>)solution.Projects).Add(project);
}
void AddCodeCoverageFile(string fileName)

20
src/AddIns/Analysis/UnitTesting/Test/NUnit/NUnitConsoleExeSelectedTestFixture.cs

@ -52,8 +52,7 @@ namespace UnitTesting.Tests.NUnit @@ -52,8 +52,7 @@ namespace UnitTesting.Tests.NUnit
[Test]
public void TargetCpuAnyCPUDotnet2()
{
project.ActiveConfiguration = "Debug";
project.ActivePlatform = "AnyCPU";
project.ActiveConfiguration = new ConfigurationAndPlatform("Debug", "AnyCPU");
project.SetProperty("PlatformTarget", "AnyCPU");
project.SetProperty("TargetFrameworkVersion", "v3.5");
@ -65,8 +64,7 @@ namespace UnitTesting.Tests.NUnit @@ -65,8 +64,7 @@ namespace UnitTesting.Tests.NUnit
[Test]
public void TargetCpuAnyCPUDotnet45()
{
project.ActiveConfiguration = "Debug";
project.ActivePlatform = "AnyCPU";
project.ActiveConfiguration = new ConfigurationAndPlatform("Debug", "AnyCPU");
project.SetProperty("PlatformTarget", "AnyCPU");
project.SetProperty("TargetFrameworkVersion", "v4.5");
@ -78,8 +76,7 @@ namespace UnitTesting.Tests.NUnit @@ -78,8 +76,7 @@ namespace UnitTesting.Tests.NUnit
[Test]
public void TargetCpuX64Dotnet2()
{
project.ActiveConfiguration = "Debug";
project.ActivePlatform = "AnyCPU";
project.ActiveConfiguration = new ConfigurationAndPlatform("Debug", "AnyCPU");
project.SetProperty("PlatformTarget", "x64");
project.SetProperty("TargetFrameworkVersion", "v3.5");
@ -90,8 +87,7 @@ namespace UnitTesting.Tests.NUnit @@ -90,8 +87,7 @@ namespace UnitTesting.Tests.NUnit
[Test]
public void TargetCpuX64Dotnet45()
{
project.ActiveConfiguration = "Debug";
project.ActivePlatform = "AnyCPU";
project.ActiveConfiguration = new ConfigurationAndPlatform("Debug", "AnyCPU");
project.SetProperty("PlatformTarget", "x64");
project.SetProperty("TargetFrameworkVersion", "v4.5");
@ -102,8 +98,7 @@ namespace UnitTesting.Tests.NUnit @@ -102,8 +98,7 @@ namespace UnitTesting.Tests.NUnit
[Test]
public void NUnitConsole32BitUsedWhenTargetCpuIs32BitDotnet2()
{
project.ActiveConfiguration = "Debug";
project.ActivePlatform = "AnyCPU";
project.ActiveConfiguration = new ConfigurationAndPlatform("Debug", "AnyCPU");
project.SetProperty("PlatformTarget", "x86");
project.SetProperty("TargetFrameworkVersion", "v3.5");
@ -114,8 +109,7 @@ namespace UnitTesting.Tests.NUnit @@ -114,8 +109,7 @@ namespace UnitTesting.Tests.NUnit
[Test]
public void NUnitConsole32BitUsedWhenTargetCpuIs32Bit()
{
project.ActiveConfiguration = "Debug";
project.ActivePlatform = "AnyCPU";
project.ActiveConfiguration = new ConfigurationAndPlatform("Debug", "AnyCPU");
project.SetProperty("PlatformTarget", "x86");
NUnitConsoleApplication app = new NUnitConsoleApplication(new[] { testProject });
@ -125,7 +119,7 @@ namespace UnitTesting.Tests.NUnit @@ -125,7 +119,7 @@ namespace UnitTesting.Tests.NUnit
[Test]
public void NotMSBuildBasedProject()
{
MissingProject project = new MissingProject(FileName.Create(@"C:\Projects\Test.proj"), "Test");
MissingProject project = new MissingProject(MockSolution.Create(), FileName.Create(@"C:\Projects\Test.proj"), "Test");
ITestProject testProject = new NUnitTestProject(project);
NUnitConsoleApplication app = new NUnitConsoleApplication(new[] { testProject });

2
src/AddIns/Analysis/UnitTesting/Test/Utils/MockCSharpProject.cs

@ -17,7 +17,7 @@ namespace UnitTesting.Tests.Utils @@ -17,7 +17,7 @@ namespace UnitTesting.Tests.Utils
IProjectContent projectContent;
public MockCSharpProject()
: this(new Solution(new MockProjectChangeWatcher()), "MyTests")
: this(MockSolution.Create(), "MyTests")
{
}

1
src/AddIns/BackendBindings/AspNet.Mvc/Test/AspNet.Mvc.Tests.csproj

@ -83,6 +83,7 @@ @@ -83,6 +83,7 @@
<Compile Include="Helpers\FakeMvcViewFileGenerator.cs" />
<Compile Include="Helpers\FakeSelectedFolderNodeInProjectsView.cs" />
<Compile Include="Helpers\FakeSelectedMvcFolder.cs" />
<Compile Include="Helpers\FakeSolution.cs" />
<Compile Include="Helpers\MSBuildProjectHelper.cs" />
<Compile Include="Helpers\MvcControllerTextTemplateCollectionAssert.cs" />
<Compile Include="Helpers\MvcProjectFileAssert.cs" />

20
src/AddIns/BackendBindings/AspNet.Mvc/Test/Helpers/FakeSolution.cs

@ -0,0 +1,20 @@ @@ -0,0 +1,20 @@
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
using System;
using ICSharpCode.SharpDevelop.Project;
using Microsoft.Build.Evaluation;
using Rhino.Mocks;
namespace AspNet.Mvc.Tests.Helpers
{
public class FakeSolution
{
public static ISolution Create()
{
ISolution solution = MockRepository.GenerateStub<ISolution>();
solution.Stub(s => s.MSBuildProjectCollection).Return(new ProjectCollection());
return solution;
}
}
}

2
src/AddIns/BackendBindings/AspNet.Mvc/Test/Helpers/MSBuildProjectHelper.cs

@ -14,7 +14,7 @@ namespace AspNet.Mvc.Tests.Helpers @@ -14,7 +14,7 @@ namespace AspNet.Mvc.Tests.Helpers
public static MSBuildBasedProject CreateCSharpProject()
{
var createInfo = new ProjectCreateInformation();
createInfo.Solution = new Solution(MockRepository.GenerateStub<IProjectChangeWatcher>());
createInfo.Solution = FakeSolution.Create();
createInfo.OutputProjectFileName = new FileName(@"d:\projects\MyProject\MyProject.csproj");
return new MSBuildBasedProject(createInfo);
}

3
src/AddIns/BackendBindings/AspNet.Mvc/Test/Helpers/TestableProject.cs

@ -6,6 +6,7 @@ using ICSharpCode.Core; @@ -6,6 +6,7 @@ using ICSharpCode.Core;
using ICSharpCode.SharpDevelop.Dom;
using ICSharpCode.SharpDevelop.Internal.Templates;
using ICSharpCode.SharpDevelop.Project;
using Rhino.Mocks;
using Dom = ICSharpCode.SharpDevelop.Dom;
namespace AspNet.Mvc.Tests.Helpers
@ -28,7 +29,7 @@ namespace AspNet.Mvc.Tests.Helpers @@ -28,7 +29,7 @@ namespace AspNet.Mvc.Tests.Helpers
public static TestableProject CreateProject(string fileName, string projectName)
{
var createInfo = new ProjectCreateInformation();
createInfo.Solution = new Solution(null);
createInfo.Solution = FakeSolution.Create();
createInfo.ProjectName = projectName;
createInfo.OutputProjectFileName = new FileName(fileName);
return new TestableProject(createInfo);

1
src/AddIns/BackendBindings/CSharpBinding/Project/CSharpBinding.addin

@ -48,7 +48,6 @@ @@ -48,7 +48,6 @@
<FileFilter id = "CSharpProject"
insertbefore="AllFiles"
name = "${res:SharpDevelop.FileFilter.CSharpPrjFiles} (*.csproj)"
class = "ICSharpCode.SharpDevelop.Project.LoadProject"
extensions = "*.csproj"/>
</Path>

10
src/AddIns/BackendBindings/CSharpBinding/Project/Src/Project/CSharpProject.cs

@ -84,7 +84,7 @@ namespace CSharpBinding @@ -84,7 +84,7 @@ namespace CSharpBinding
public override Task<bool> BuildAsync(ProjectBuildOptions options, IBuildFeedbackSink feedbackSink, IProgressMonitor progressMonitor)
{
if (this.MinimumSolutionVersion == ISolution.SolutionVersionVS2005) {
if (this.MinimumSolutionVersion == SolutionFormatVersion.VS2005) {
return MSBuildEngine.BuildAsync(
this, options, feedbackSink, progressMonitor.CancellationToken,
MSBuildEngine.AdditionalTargetFiles.Concat(
@ -177,12 +177,12 @@ namespace CSharpBinding @@ -177,12 +177,12 @@ namespace CSharpBinding
public override CompilerVersion CurrentCompilerVersion {
get {
switch (Project.MinimumSolutionVersion) {
case ISolution.SolutionVersionVS2005:
case SolutionFormatVersion.VS2005:
return msbuild20;
case ISolution.SolutionVersionVS2008:
case SolutionFormatVersion.VS2008:
return msbuild35;
case ISolution.SolutionVersionVS2010:
case ISolution.SolutionVersionVS2012:
case SolutionFormatVersion.VS2010:
case SolutionFormatVersion.VS2012:
return msbuild40;
default:
throw new NotSupportedException();

1
src/AddIns/BackendBindings/CppBinding/CppBinding/CppBinding.addin

@ -42,7 +42,6 @@ @@ -42,7 +42,6 @@
<FileFilter id="C++Project"
insertbefore="AllFiles"
name="C++ project files (*.vcxproj)"
class="ICSharpCode.SharpDevelop.Project.LoadProject"
extensions="*.vcxproj" />
</Path>

7
src/AddIns/BackendBindings/CppBinding/CppBinding/Project/ApplicationOptions.cs

@ -37,7 +37,7 @@ namespace ICSharpCode.CppBinding.Project @@ -37,7 +37,7 @@ namespace ICSharpCode.CppBinding.Project
void SetOutputTypeCombo()
{
MSBuildItemDefinitionGroup group = new MSBuildItemDefinitionGroup(base.Project, base.Project.ActiveConfiguration, base.Project.ActivePlatform);
MSBuildItemDefinitionGroup group = new MSBuildItemDefinitionGroup(base.Project, base.Project.ActiveConfiguration);
string subsystem = group.GetElementMetadata("Link", "SubSystem");
string configurationType = base.Project.GetEvaluatedProperty("ConfigurationType");
OutputType validOutputType = ConfigurationTypeToOutputType(configurationType, subsystem);
@ -61,7 +61,7 @@ namespace ICSharpCode.CppBinding.Project @@ -61,7 +61,7 @@ namespace ICSharpCode.CppBinding.Project
void project_MinimumSolutionVersionChanged(object sender, EventArgs e)
{
// embedding manifests requires the project to target MSBuild 3.5 or higher
applicationManifestComboBox.IsEnabled = base.Project.MinimumSolutionVersion >= ISolution.SolutionVersionVS2008;
applicationManifestComboBox.IsEnabled = base.Project.MinimumSolutionVersion >= SolutionFormatVersion.VS2008;
}
@ -171,8 +171,7 @@ namespace ICSharpCode.CppBinding.Project @@ -171,8 +171,7 @@ namespace ICSharpCode.CppBinding.Project
OutputType outputType = values[this.outputTypeComboBox.SelectedIndex];
string subsystem = OutputTypeToSubsystem(outputType);
MSBuildItemDefinitionGroup group = new MSBuildItemDefinitionGroup(base.Project,
base.Project.ActiveConfiguration, base.Project.ActivePlatform);
MSBuildItemDefinitionGroup group = new MSBuildItemDefinitionGroup(base.Project, base.Project.ActiveConfiguration);
group.SetElementMetadata("Link", "SubSystem", subsystem);
return OutputTypeToConfigurationType(outputType);

8
src/AddIns/BackendBindings/CppBinding/CppBinding/Project/CppProject.cs

@ -173,11 +173,11 @@ namespace ICSharpCode.CppBinding.Project @@ -173,11 +173,11 @@ namespace ICSharpCode.CppBinding.Project
ProjectRootElement file = MSBuildProjectFile;
ProjectItemGroupElement configItemGroup = file.AddItemGroup();
configItemGroup.Label = "ProjectConfigurations";
foreach (string target in new string[] { "Debug|Win32", "Release|Win32" })
foreach (var target in new [] { new ConfigurationAndPlatform("Debug", "Win32"), new ConfigurationAndPlatform("Release", "Win32") })
{
ProjectItemElement prjConfiguration = configItemGroup.AddItem("ProjectConfiguration", target);
prjConfiguration.AddMetadata("Configuration", GetConfigurationNameFromKey(target));
prjConfiguration.AddMetadata("Platform", GetPlatformNameFromKey(target));
ProjectItemElement prjConfiguration = configItemGroup.AddItem("ProjectConfiguration", target.ToString());
prjConfiguration.AddMetadata("Configuration", target.Configuration);
prjConfiguration.AddMetadata("Platform", target.Platform);
}
}

5
src/AddIns/BackendBindings/CppBinding/CppBinding/Project/LinkerOptions.xaml.cs

@ -56,7 +56,7 @@ namespace ICSharpCode.CppBinding.Project @@ -56,7 +56,7 @@ namespace ICSharpCode.CppBinding.Project
protected override void Initialize()
{
var msDefGroup = new MSBuildItemDefinitionGroup(base.Project, base.Project.ActiveConfiguration, base.Project.ActivePlatform);
var msDefGroup = new MSBuildItemDefinitionGroup(base.Project, base.Project.ActiveConfiguration);
this.additionalLibsTextBox.Text = GetElementMetaData(msDefGroup,"AdditionalDependencies");
@ -79,8 +79,7 @@ namespace ICSharpCode.CppBinding.Project @@ -79,8 +79,7 @@ namespace ICSharpCode.CppBinding.Project
protected override bool Save(MSBuildBasedProject project, string configuration, string platform)
{
MSBuildItemDefinitionGroup group = new MSBuildItemDefinitionGroup(project,
project.ActiveConfiguration, project.ActivePlatform);
MSBuildItemDefinitionGroup group = new MSBuildItemDefinitionGroup(project, project.ActiveConfiguration);
SetElementMetaData(group,"AdditionalDependencies",this.additionalLibsTextBox.Text);
SetElementMetaData(group,"AddModuleNamesToAssembly",this.addModuleTextBox.Text);

6
src/AddIns/BackendBindings/CppBinding/CppBinding/Project/PreprocessorOptions.xaml.cs

@ -54,8 +54,7 @@ namespace ICSharpCode.CppBinding.Project @@ -54,8 +54,7 @@ namespace ICSharpCode.CppBinding.Project
protected override void Initialize()
{
MSBuildItemDefinitionGroup group = new MSBuildItemDefinitionGroup(base.Project,
base.Project.ActiveConfiguration, base.Project.ActivePlatform);
MSBuildItemDefinitionGroup group = new MSBuildItemDefinitionGroup(base.Project, base.Project.ActiveConfiguration);
this.defineTextBox.Text = GetElementMetaData(group,"PreprocessorDefinitions");
@ -75,8 +74,7 @@ namespace ICSharpCode.CppBinding.Project @@ -75,8 +74,7 @@ namespace ICSharpCode.CppBinding.Project
protected override bool Save(MSBuildBasedProject project, string configuration, string platform)
{
MSBuildItemDefinitionGroup group = new MSBuildItemDefinitionGroup(project,
project.ActiveConfiguration, project.ActivePlatform);
MSBuildItemDefinitionGroup group = new MSBuildItemDefinitionGroup(project, project.ActiveConfiguration);
SetElementMetaData(group,"PreprocessorDefinitions",this.defineTextBox.Text);

2
src/AddIns/BackendBindings/CppBinding/CppBinding/Project/SpecifyCliRuntimeLibraryCommand.cs

@ -28,7 +28,7 @@ namespace ICSharpCode.CppBinding.Project @@ -28,7 +28,7 @@ namespace ICSharpCode.CppBinding.Project
private static void SpecifyRuntimeLibrary(MSBuildBasedProject project, string configuration, string runtime)
{
MSBuildItemDefinitionGroup group = new MSBuildItemDefinitionGroup(project, configuration, null);
MSBuildItemDefinitionGroup group = new MSBuildItemDefinitionGroup(project, new ConfigurationAndPlatform(configuration, null));
group.SetElementMetadata("ClCompile", "RuntimeLibrary", runtime);
}
}

1
src/AddIns/BackendBindings/FSharpBinding/FSharpBinding.addin

@ -44,7 +44,6 @@ @@ -44,7 +44,6 @@
<FileFilter id = "FSharpProject"
insertbefore="AllFiles"
name = "F# Project Files (*.fsproj)"
class = "ICSharpCode.SharpDevelop.Project.LoadProject"
extensions = "*.fsproj"/>
</Path>

1
src/AddIns/BackendBindings/Scripting/Test/ICSharpCode.Scripting.Tests.csproj

@ -150,7 +150,6 @@ @@ -150,7 +150,6 @@
<Compile Include="Utils\MockMemberProvider.cs" />
<Compile Include="Utils\MockMethod.cs" />
<Compile Include="Utils\MockOpenedFile.cs" />
<Compile Include="Utils\MockProject.cs" />
<Compile Include="Utils\MockProjectContent.cs" />
<Compile Include="Utils\MockPropertyDescriptor.cs" />
<Compile Include="Utils\MockResourceReader.cs" />

340
src/AddIns/BackendBindings/Scripting/Test/Utils/MockProject.cs

@ -1,340 +0,0 @@ @@ -1,340 +0,0 @@
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
using System;
using System.Collections.Generic;
using ICSharpCode.Core;
using ICSharpCode.NRefactory.TypeSystem;
using ICSharpCode.SharpDevelop;
using ICSharpCode.SharpDevelop.Project;
namespace ICSharpCode.Scripting.Tests.Utils
{
public class MockProject : IProject
{
readonly object syncRoot = new object();
string directory = String.Empty;
string rootNamespace = String.Empty;
public MockProject()
{
}
public bool ReadOnly {
get { return false; }
}
public string Directory {
get { return directory; }
set { directory = value; }
}
public string RootNamespace {
get { return rootNamespace; }
set { rootNamespace = value; }
}
string language = String.Empty;
public string Language {
get {
return language;
}
set {
language = value;
}
}
public event EventHandler ActiveConfigurationChanged { add {} remove {} }
public event EventHandler ActivePlatformChanged { add {} remove {} }
public object SyncRoot {
get { return syncRoot; }
}
public ISolution ParentSolution {
get { return new Solution(new MockProjectChangeWatcher()); }
}
public event EventHandler<ICSharpCode.SharpDevelop.Parser.ParseInformationEventArgs> ParseInformationUpdated { add {} remove {} }
public IReadOnlyCollection<ProjectItem> Items {
get {
throw new NotImplementedException();
}
}
public IReadOnlyCollection<ItemType> AvailableFileItemTypes {
get {
throw new NotImplementedException();
}
}
public List<ProjectSection> ProjectSections {
get {
throw new NotImplementedException();
}
}
public FileName FileName {
get {
throw new NotImplementedException();
}
set {
throw new NotImplementedException();
}
}
public string Name {
get {
throw new NotImplementedException();
}
set {
throw new NotImplementedException();
}
}
public string AssemblyName {
get {
throw new NotImplementedException();
}
set {
throw new NotImplementedException();
}
}
public string OutputAssemblyFullPath {
get {
throw new NotImplementedException();
}
}
public string AppDesignerFolder {
get {
throw new NotImplementedException();
}
}
public string ActiveConfiguration {
get {
throw new NotImplementedException();
}
set {
throw new NotImplementedException();
}
}
public string ActivePlatform {
get {
throw new NotImplementedException();
}
set {
throw new NotImplementedException();
}
}
public IReadOnlyCollection<string> ConfigurationNames {
get {
throw new NotImplementedException();
}
}
public IReadOnlyCollection<string> PlatformNames {
get {
throw new NotImplementedException();
}
}
public bool IsStartable {
get {
throw new NotImplementedException();
}
}
public Properties ProjectSpecificProperties {
get {
throw new NotImplementedException();
}
}
public int MinimumSolutionVersion {
get {
throw new NotImplementedException();
}
}
public IProjectContent ProjectContent {
get {
throw new NotImplementedException();
}
}
public ICSharpCode.SharpDevelop.Refactoring.ICodeGenerator CodeGenerator {
get {
throw new NotImplementedException();
}
}
public ICSharpCode.SharpDevelop.Dom.ITypeDefinitionModelCollection TypeDefinitionModels {
get {
throw new NotImplementedException();
}
}
public ISolutionFolder Parent {
get {
throw new NotImplementedException();
}
set {
throw new NotImplementedException();
}
}
public string TypeGuid {
get {
throw new NotImplementedException();
}
set {
throw new NotImplementedException();
}
}
public string IdGuid {
get {
throw new NotImplementedException();
}
set {
throw new NotImplementedException();
}
}
public string Location {
get {
throw new NotImplementedException();
}
set {
throw new NotImplementedException();
}
}
public IEnumerable<ProjectItem> GetItemsOfType(ItemType type)
{
throw new NotImplementedException();
}
public ItemType GetDefaultItemType(string fileName)
{
throw new NotImplementedException();
}
public void Save()
{
throw new NotImplementedException();
}
public bool IsFileInProject(string fileName)
{
throw new NotImplementedException();
}
public FileProjectItem FindFile(string fileName)
{
throw new NotImplementedException();
}
public void Start(bool withDebugging)
{
throw new NotImplementedException();
}
public ProjectItem CreateProjectItem(IProjectItemBackendStore item)
{
throw new NotImplementedException();
}
public IEnumerable<ReferenceProjectItem> ResolveAssemblyReferences(System.Threading.CancellationToken cancellationToken)
{
throw new NotImplementedException();
}
public void ProjectCreationComplete()
{
throw new NotImplementedException();
}
public System.Xml.Linq.XElement LoadProjectExtensions(string name)
{
throw new NotImplementedException();
}
public void SaveProjectExtensions(string name, System.Xml.Linq.XElement element)
{
throw new NotImplementedException();
}
public bool HasProjectType(Guid projectTypeGuid)
{
throw new NotImplementedException();
}
public string GetDefaultNamespace(string fileName)
{
throw new NotImplementedException();
}
public System.CodeDom.Compiler.CodeDomProvider CreateCodeDomProvider()
{
throw new NotImplementedException();
}
public void GenerateCodeFromCodeDom(System.CodeDom.CodeCompileUnit compileUnit, System.IO.TextWriter writer)
{
throw new NotImplementedException();
}
public IAmbience GetAmbience()
{
throw new NotImplementedException();
}
public ICSharpCode.SharpDevelop.Refactoring.ISymbolSearch PrepareSymbolSearch(IEntity entity)
{
throw new NotImplementedException();
}
public void OnParseInformationUpdated(ICSharpCode.SharpDevelop.Parser.ParseInformationEventArgs args)
{
throw new NotImplementedException();
}
public IEnumerable<IBuildable> GetBuildDependencies(ProjectBuildOptions buildOptions)
{
throw new NotImplementedException();
}
public System.Threading.Tasks.Task<bool> BuildAsync(ProjectBuildOptions options, IBuildFeedbackSink feedbackSink, IProgressMonitor progressMonitor)
{
throw new NotImplementedException();
}
public ProjectBuildOptions CreateProjectBuildOptions(BuildOptions options, bool isRootBuildable)
{
throw new NotImplementedException();
}
public void Dispose()
{
throw new NotImplementedException();
}
public Properties CreateMemento()
{
throw new NotImplementedException();
}
public void SetMemento(Properties memento)
{
throw new NotImplementedException();
}
}
}

1
src/AddIns/BackendBindings/WixBinding/Project/WixBinding.addin

@ -20,7 +20,6 @@ @@ -20,7 +20,6 @@
<FileFilter id = "WixProject"
insertbefore = "AllFiles"
name = "${res:ICSharpCode.WixBinding.WixProjectFilesFilterName} (*.wixproj)"
class = "ICSharpCode.SharpDevelop.Project.LoadProject"
extensions = "*.wixproj"/>
</Path>

4
src/AddIns/BackendBindings/WixBinding/Test/DialogLoading/BitmapFromProjectTestFixture.cs

@ -1,6 +1,7 @@ @@ -1,6 +1,7 @@
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
using ICSharpCode.SharpDevelop;
using ICSharpCode.WixBinding;
using ICSharpCode.SharpDevelop.Project;
using NUnit.Framework;
@ -25,7 +26,8 @@ namespace WixBinding.Tests.Document @@ -25,7 +26,8 @@ namespace WixBinding.Tests.Document
[TestFixtureSetUp]
public void SetUpFixture()
{
MessageLoopHelper.InitializeForUnitTests();
SD.InitializeForUnitTests();
MessageLoopHelper.RegisterStubService();
BitmapFileNamesRequested.Clear();
CreatedComponents.Clear();

2
src/AddIns/BackendBindings/WixBinding/Test/DialogLoading/BitmapTestFixture.cs

@ -27,7 +27,7 @@ namespace WixBinding.Tests.DialogLoading @@ -27,7 +27,7 @@ namespace WixBinding.Tests.DialogLoading
public void SetUpFixture()
{
SD.InitializeForUnitTests();
MessageLoopHelper.InitializeForUnitTests();
MessageLoopHelper.RegisterStubService();
BitmapFileNamesRequested.Clear();
CreatedComponents.Clear();

2
src/AddIns/BackendBindings/WixBinding/Test/DialogLoading/InvalidLocationTests.cs

@ -27,7 +27,7 @@ namespace WixBinding.Tests.DialogLoading @@ -27,7 +27,7 @@ namespace WixBinding.Tests.DialogLoading
public void SetupFixture()
{
SD.InitializeForUnitTests();
MessageLoopHelper.InitializeForUnitTests();
MessageLoopHelper.RegisterStubService();
WixBindingTestsHelper.RegisterResourceStringsWithSharpDevelopResourceManager();
}

2
src/AddIns/BackendBindings/WixBinding/Test/DialogLoading/InvalidSizeTests.cs

@ -27,7 +27,7 @@ namespace WixBinding.Tests.DialogLoading @@ -27,7 +27,7 @@ namespace WixBinding.Tests.DialogLoading
public void SetupFixture()
{
SD.InitializeForUnitTests();
MessageLoopHelper.InitializeForUnitTests();
MessageLoopHelper.RegisterStubService();
WixBindingTestsHelper.RegisterResourceStringsWithSharpDevelopResourceManager();
}

2
src/AddIns/BackendBindings/WixBinding/Test/DialogLoading/MissingBitmapBinaryTestFixture.cs

@ -31,7 +31,7 @@ namespace WixBinding.Tests.DialogLoading @@ -31,7 +31,7 @@ namespace WixBinding.Tests.DialogLoading
public void SetUpFixture()
{
SD.InitializeForUnitTests();
MessageLoopHelper.InitializeForUnitTests();
MessageLoopHelper.RegisterStubService();
BitmapFileNamesRequested.Clear();
WixProject project = WixBindingTestsHelper.CreateEmptyWixProject();
WixDocument doc = new WixDocument(project, this);

2
src/AddIns/BackendBindings/WixBinding/Test/DialogLoading/NullComponentCreatorTestFixture.cs

@ -25,7 +25,7 @@ namespace WixBinding.Tests.DialogLoading @@ -25,7 +25,7 @@ namespace WixBinding.Tests.DialogLoading
public void CreateDialog()
{
SD.InitializeForUnitTests();
MessageLoopHelper.InitializeForUnitTests();
MessageLoopHelper.RegisterStubService();
WixProject project = WixBindingTestsHelper.CreateEmptyWixProject();
WixDocument doc = new WixDocument(project);
doc.LoadXml(GetWixXml());

3
src/AddIns/BackendBindings/WixBinding/Test/Document/ChildDirectoriesTestFixture.cs

@ -5,7 +5,7 @@ using System; @@ -5,7 +5,7 @@ using System;
using System.IO;
using System.Resources;
using System.Xml;
using ICSharpCode.SharpDevelop;
using ICSharpCode.WixBinding;
using NUnit.Framework;
using WixBinding.Tests.Utils;
@ -29,6 +29,7 @@ namespace WixBinding.Tests.Document @@ -29,6 +29,7 @@ namespace WixBinding.Tests.Document
[TestFixtureSetUp]
public void SetUpFixture()
{
SD.InitializeForUnitTests();
WixBindingTestsHelper.RegisterResourceStringsWithSharpDevelopResourceManager();
WixDocument doc = new WixDocument();

3
src/AddIns/BackendBindings/WixBinding/Test/Document/DirectoryNameTests.cs

@ -3,8 +3,8 @@ @@ -3,8 +3,8 @@
using System;
using System.Resources;
using ICSharpCode.Core;
using ICSharpCode.SharpDevelop;
using ICSharpCode.WixBinding;
using NUnit.Framework;
using WixBinding.Tests.Utils;
@ -17,6 +17,7 @@ namespace WixBinding.Tests.Document @@ -17,6 +17,7 @@ namespace WixBinding.Tests.Document
[TestFixtureSetUp]
public void SetupFixture()
{
SD.InitializeForUnitTests();
WixBindingTestsHelper.RegisterResourceStringsWithSharpDevelopResourceManager();
}

4
src/AddIns/BackendBindings/WixBinding/Test/Document/DuplicateBinaryIdTestFixture.cs

@ -1,6 +1,7 @@ @@ -1,6 +1,7 @@
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
using ICSharpCode.SharpDevelop;
using ICSharpCode.WixBinding;
using ICSharpCode.SharpDevelop.Project;
using NUnit.Framework;
@ -24,7 +25,8 @@ namespace WixBinding.Tests.Document @@ -24,7 +25,8 @@ namespace WixBinding.Tests.Document
[TestFixtureSetUp]
public void SetUpFixture()
{
MessageLoopHelper.InitializeForUnitTests();
SD.InitializeForUnitTests();
MessageLoopHelper.RegisterStubService();
WixProject p = WixBindingTestsHelper.CreateEmptyWixProject();
projectDirectory = p.Directory;
p.Name = "MySetup";

4
src/AddIns/BackendBindings/WixBinding/Test/Document/GetBinaryFileNameFromProjectTestFixture.cs

@ -1,6 +1,7 @@ @@ -1,6 +1,7 @@
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
using ICSharpCode.SharpDevelop;
using ICSharpCode.WixBinding;
using ICSharpCode.SharpDevelop.Project;
using NUnit.Framework;
@ -25,7 +26,8 @@ namespace WixBinding.Tests.Document @@ -25,7 +26,8 @@ namespace WixBinding.Tests.Document
[TestFixtureSetUp]
public void SetUpFixture()
{
MessageLoopHelper.InitializeForUnitTests();
SD.InitializeForUnitTests();
MessageLoopHelper.RegisterStubService();
WixProject p = WixBindingTestsHelper.CreateEmptyWixProject();
projectDirectory = p.Directory;
p.Name = "MySetup";

4
src/AddIns/BackendBindings/WixBinding/Test/Document/GetBinaryFileNameFromVariablesTestFixture.cs

@ -1,6 +1,7 @@ @@ -1,6 +1,7 @@
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
using ICSharpCode.SharpDevelop;
using ICSharpCode.WixBinding;
using NUnit.Framework;
using System;
@ -20,7 +21,8 @@ namespace WixBinding.Tests.Document @@ -20,7 +21,8 @@ namespace WixBinding.Tests.Document
[SetUp]
public void Init()
{
MessageLoopHelper.InitializeForUnitTests();
SD.InitializeForUnitTests();
MessageLoopHelper.RegisterStubService();
WixProject project = WixBindingTestsHelper.CreateEmptyWixProject();
project.SetProperty("DefineConstants", @"DATADIR=Bitmaps;");
document = new WixDocument(project);

4
src/AddIns/BackendBindings/WixBinding/Test/Document/GetBinaryFileNameTestFixture.cs

@ -1,6 +1,7 @@ @@ -1,6 +1,7 @@
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
using ICSharpCode.SharpDevelop;
using ICSharpCode.WixBinding;
using NUnit.Framework;
using System;
@ -21,7 +22,8 @@ namespace WixBinding.Tests.Document @@ -21,7 +22,8 @@ namespace WixBinding.Tests.Document
[TestFixtureSetUp]
public void SetUpFixture()
{
MessageLoopHelper.InitializeForUnitTests();
SD.InitializeForUnitTests();
MessageLoopHelper.RegisterStubService();
document = new WixDocument();
document.LoadXml(GetWixXml());
}

5
src/AddIns/BackendBindings/WixBinding/Test/Document/WixDocumentSaveTests.cs

@ -5,7 +5,7 @@ using System; @@ -5,7 +5,7 @@ using System;
using System.IO;
using System.Text;
using System.Xml;
using ICSharpCode.SharpDevelop;
using ICSharpCode.WixBinding;
using NUnit.Framework;
using WixBinding.Tests.Utils;
@ -22,7 +22,8 @@ namespace WixBinding.Tests.Document @@ -22,7 +22,8 @@ namespace WixBinding.Tests.Document
[SetUp]
public void Init()
{
MessageLoopHelper.InitializeForUnitTests();
SD.InitializeForUnitTests();
MessageLoopHelper.RegisterStubService();
WixProject project = WixBindingTestsHelper.CreateEmptyWixProject();
document = new WixDocument(project, new DefaultFileLoader());
string xml = "<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi'><Product Name='MySetup'></Product></Wix>";

3
src/AddIns/BackendBindings/WixBinding/Test/Gui/AddWixProjectNodeTestFixture.cs

@ -2,6 +2,7 @@ @@ -2,6 +2,7 @@
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
using ICSharpCode.Core;
using ICSharpCode.SharpDevelop;
using ICSharpCode.SharpDevelop.Internal.Templates;
using ICSharpCode.SharpDevelop.Project;
using ICSharpCode.WixBinding;
@ -30,6 +31,8 @@ namespace WixBinding.Tests.Gui @@ -30,6 +31,8 @@ namespace WixBinding.Tests.Gui
[TestFixtureSetUp]
public void SetUpFixture()
{
SD.InitializeForUnitTests();
MessageLoopHelper.RegisterStubService();
WixBindingTestsHelper.RegisterResourceStringsWithSharpDevelopResourceManager();
wixProject = WixBindingTestsHelper.CreateEmptyWixProject();

8
src/AddIns/BackendBindings/WixBinding/Test/Gui/DeleteWixExtensionNodeTestFixture.cs

@ -2,12 +2,15 @@ @@ -2,12 +2,15 @@
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
using ICSharpCode.Core;
using ICSharpCode.SharpDevelop;
using ICSharpCode.SharpDevelop.Internal.Templates;
using ICSharpCode.SharpDevelop.Project;
using ICSharpCode.WixBinding;
using Microsoft.Build.Evaluation;
using NUnit.Framework;
using System;
using System.Windows.Forms;
using Rhino.Mocks;
using WixBinding.Tests.Utils;
namespace WixBinding.Tests.Gui
@ -26,12 +29,13 @@ namespace WixBinding.Tests.Gui @@ -26,12 +29,13 @@ namespace WixBinding.Tests.Gui
[TestFixtureSetUp]
public void SetUpFixture()
{
MessageLoopHelper.InitializeForUnitTests();
SD.InitializeForUnitTests();
MessageLoopHelper.RegisterStubService();
WixBindingTestsHelper.InitMSBuildEngine();
// create the project.
ProjectCreateInformation info = new ProjectCreateInformation();
info.Solution = new Solution(new MockProjectChangeWatcher());
info.Solution = MockSolution.Create();
info.ProjectName = "Test";
info.OutputProjectFileName = new FileName(@"C:\Projects\Test\Test.wixproj");

12
src/AddIns/BackendBindings/WixBinding/Test/Gui/DeleteWixLibraryNodeTestFixture.cs

@ -1,13 +1,16 @@ @@ -1,13 +1,16 @@
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
using System;
using System.Windows.Forms;
using ICSharpCode.Core;
using ICSharpCode.SharpDevelop;
using ICSharpCode.SharpDevelop.Internal.Templates;
using ICSharpCode.SharpDevelop.Project;
using ICSharpCode.WixBinding;
using Microsoft.Build.Evaluation;
using NUnit.Framework;
using System;
using System.Windows.Forms;
using Rhino.Mocks;
using WixBinding.Tests.Utils;
namespace WixBinding.Tests.Gui
@ -26,12 +29,13 @@ namespace WixBinding.Tests.Gui @@ -26,12 +29,13 @@ namespace WixBinding.Tests.Gui
[TestFixtureSetUp]
public void SetUpFixture()
{
MessageLoopHelper.InitializeForUnitTests();
SD.InitializeForUnitTests();
MessageLoopHelper.RegisterStubService();
WixBindingTestsHelper.InitMSBuildEngine();
// create the project.
ProjectCreateInformation info = new ProjectCreateInformation();
info.Solution = new Solution(new MockProjectChangeWatcher());
info.Solution = MockSolution.Create();
info.ProjectName = "Test";
info.OutputProjectFileName = new FileName(@"C:\Projects\Test\Test.wixproj");

3
src/AddIns/BackendBindings/WixBinding/Test/Gui/ShowExistingPackageFilesViewTestFixture.cs

@ -21,7 +21,8 @@ namespace WixBinding.Tests.Gui @@ -21,7 +21,8 @@ namespace WixBinding.Tests.Gui
[SetUp]
public void Init()
{
MessageLoopHelper.InitializeForUnitTests();
SD.InitializeForUnitTests();
MessageLoopHelper.RegisterStubService();
workbench = new MockWorkbench();
CreatePackageFilesViewWithDifferentWixProject();

4
src/AddIns/BackendBindings/WixBinding/Test/Gui/ShowSetupFilesTestFixture.cs

@ -2,6 +2,7 @@ @@ -2,6 +2,7 @@
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
using System;
using ICSharpCode.SharpDevelop;
using ICSharpCode.WixBinding;
using NUnit.Framework;
using WixBinding.Tests.Utils;
@ -18,7 +19,8 @@ namespace WixBinding.Tests.Gui @@ -18,7 +19,8 @@ namespace WixBinding.Tests.Gui
[SetUp]
public void Init()
{
MessageLoopHelper.InitializeForUnitTests();
SD.InitializeForUnitTests();
MessageLoopHelper.RegisterStubService();
workbench = new MockWorkbench();
factory = new MockPackageFilesViewFactory();

4
src/AddIns/BackendBindings/WixBinding/Test/Gui/WixDocumentEditorReplaceElementTestFixture.cs

@ -3,6 +3,7 @@ @@ -3,6 +3,7 @@
using System;
using ICSharpCode.NRefactory.TypeSystem;
using ICSharpCode.SharpDevelop;
using ICSharpCode.WixBinding;
using NUnit.Framework;
using WixBinding.Tests.Utils;
@ -19,7 +20,8 @@ namespace WixBinding.Tests.Gui @@ -19,7 +20,8 @@ namespace WixBinding.Tests.Gui
[SetUp]
public void Init()
{
MessageLoopHelper.InitializeForUnitTests();
SD.InitializeForUnitTests();
MessageLoopHelper.RegisterStubService();
textEditor = new MockTextEditor();
textEditor.Document.Text = GetWixXml();

4
src/AddIns/BackendBindings/WixBinding/Test/Gui/WixDocumentWindowIsActiveTests.cs

@ -3,6 +3,7 @@ @@ -3,6 +3,7 @@
using System;
using ICSharpCode.Core;
using ICSharpCode.SharpDevelop;
using ICSharpCode.WixBinding;
using NUnit.Framework;
using WixBinding.Tests.Utils;
@ -19,7 +20,8 @@ namespace WixBinding.Tests.Gui @@ -19,7 +20,8 @@ namespace WixBinding.Tests.Gui
[SetUp]
public void Init()
{
MessageLoopHelper.InitializeForUnitTests();
SD.InitializeForUnitTests();
MessageLoopHelper.RegisterStubService();
workbench = new MockWorkbench();
window = new WixDocumentWindow(workbench);

4
src/AddIns/BackendBindings/WixBinding/Test/Gui/WixProjectWithLibraryItemsTestFixture.cs

@ -1,6 +1,7 @@ @@ -1,6 +1,7 @@
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
using ICSharpCode.SharpDevelop;
using ICSharpCode.SharpDevelop.Internal.Templates;
using ICSharpCode.SharpDevelop.Project;
using ICSharpCode.WixBinding;
@ -27,7 +28,8 @@ namespace WixBinding.Tests.Gui @@ -27,7 +28,8 @@ namespace WixBinding.Tests.Gui
[TestFixtureSetUp]
public void SetUpFixture()
{
MessageLoopHelper.InitializeForUnitTests();
SD.InitializeForUnitTests();
MessageLoopHelper.RegisterStubService();
wixProject = WixBindingTestsHelper.CreateEmptyWixProject();
// Add wix library item.

4
src/AddIns/BackendBindings/WixBinding/Test/Gui/WixProjectWithUnexpandedLibraryItemsTestFixture.cs

@ -1,6 +1,7 @@ @@ -1,6 +1,7 @@
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
using ICSharpCode.SharpDevelop;
using ICSharpCode.SharpDevelop.Internal.Templates;
using ICSharpCode.SharpDevelop.Project;
using ICSharpCode.WixBinding;
@ -28,7 +29,8 @@ namespace WixBinding.Tests.Gui @@ -28,7 +29,8 @@ namespace WixBinding.Tests.Gui
[TestFixtureSetUp]
public void SetUpFixture()
{
MessageLoopHelper.InitializeForUnitTests();
SD.InitializeForUnitTests();
MessageLoopHelper.RegisterStubService();
wixProject = WixBindingTestsHelper.CreateEmptyWixProject();
// Add wix library item.

4
src/AddIns/BackendBindings/WixBinding/Test/Gui/WixProjectWithWixExtensionItemsTestFixture.cs

@ -1,6 +1,7 @@ @@ -1,6 +1,7 @@
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
using ICSharpCode.SharpDevelop;
using ICSharpCode.SharpDevelop.Internal.Templates;
using ICSharpCode.SharpDevelop.Project;
using ICSharpCode.WixBinding;
@ -27,7 +28,8 @@ namespace WixBinding.Tests.Gui @@ -27,7 +28,8 @@ namespace WixBinding.Tests.Gui
[TestFixtureSetUp]
public void SetUpFixture()
{
MessageLoopHelper.InitializeForUnitTests();
SD.InitializeForUnitTests();
MessageLoopHelper.RegisterStubService();
wixProject = WixBindingTestsHelper.CreateEmptyWixProject();
// Add wix Extension item.

2
src/AddIns/BackendBindings/WixBinding/Test/PackageFiles/ActivePackageFilesViewTests.cs

@ -19,7 +19,7 @@ namespace WixBinding.Tests.PackageFiles @@ -19,7 +19,7 @@ namespace WixBinding.Tests.PackageFiles
public void Init()
{
SD.InitializeForUnitTests();
MessageLoopHelper.InitializeForUnitTests();
MessageLoopHelper.RegisterStubService();
workbench = new MockWorkbench();
activePackageFilesView = new ActivePackageFilesView(workbench);
}

2
src/AddIns/BackendBindings/WixBinding/Test/PackageFiles/ActiveViewChangedWhenPackageFilesOpenTestFixtureBase.cs

@ -22,7 +22,7 @@ namespace WixBinding.Tests.PackageFiles @@ -22,7 +22,7 @@ namespace WixBinding.Tests.PackageFiles
public void Init()
{
SD.InitializeForUnitTests();
MessageLoopHelper.InitializeForUnitTests();
MessageLoopHelper.RegisterStubService();
viewWithOpenWixDocument = new MockTextEditorViewContent();
viewWithOpenWixDocument.SetFileName(@"d:\projects\test\a.wxs");

2
src/AddIns/BackendBindings/WixBinding/Test/PackageFiles/AllowedChildElementsTestFixture.cs

@ -1,6 +1,7 @@ @@ -1,6 +1,7 @@
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
using ICSharpCode.SharpDevelop;
using ICSharpCode.SharpDevelop.Project;
using ICSharpCode.WixBinding;
using NUnit.Framework;
@ -25,7 +26,6 @@ namespace WixBinding.Tests.PackageFiles @@ -25,7 +26,6 @@ namespace WixBinding.Tests.PackageFiles
[TestFixtureSetUp]
public void SetUpFixture()
{
MessageLoopHelper.InitializeForUnitTests();
base.InitFixture();
childElementAllowedWhenNoItemSelected = new string[view.AllowedChildElements.Count];
view.AllowedChildElements.CopyTo(childElementAllowedWhenNoItemSelected, 0);

2
src/AddIns/BackendBindings/WixBinding/Test/PackageFiles/FileIdGenerationTests.cs

@ -19,7 +19,7 @@ namespace WixBinding.Tests.PackageFiles @@ -19,7 +19,7 @@ namespace WixBinding.Tests.PackageFiles
public void SetupFixture()
{
SD.InitializeForUnitTests();
MessageLoopHelper.InitializeForUnitTests();
MessageLoopHelper.RegisterStubService();
doc = new WixDocument();
doc.FileName = @"C:\Projects\Setup\Setup.wxs";
doc.LoadXml("<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi'/>");

2
src/AddIns/BackendBindings/WixBinding/Test/PackageFiles/NoWixSourceFileInProjectTestFixture.cs

@ -21,7 +21,7 @@ namespace WixBinding.Tests.PackageFiles @@ -21,7 +21,7 @@ namespace WixBinding.Tests.PackageFiles
public void SetUpFixture()
{
SD.InitializeForUnitTests();
MessageLoopHelper.InitializeForUnitTests();
MessageLoopHelper.RegisterStubService();
WixProject p = WixBindingTestsHelper.CreateEmptyWixProject();
p.Name = "MySetup";
view = new MockWixPackageFilesView();

2
src/AddIns/BackendBindings/WixBinding/Test/PackageFiles/OpenTextEditorsTestFixture.cs

@ -21,7 +21,7 @@ namespace WixBinding.Tests.PackageFiles @@ -21,7 +21,7 @@ namespace WixBinding.Tests.PackageFiles
public void Init()
{
SD.InitializeForUnitTests();
MessageLoopHelper.InitializeForUnitTests();
MessageLoopHelper.RegisterStubService();
existingTextEditor = new MockTextEditor();
MockTextEditorViewContent viewContent = new MockTextEditorViewContent();
viewContent.TextEditor = existingTextEditor;

2
src/AddIns/BackendBindings/WixBinding/Test/PackageFiles/PackageFilesTestFixtureBase.cs

@ -28,7 +28,7 @@ namespace WixBinding.Tests.PackageFiles @@ -28,7 +28,7 @@ namespace WixBinding.Tests.PackageFiles
public void InitFixture()
{
SD.InitializeForUnitTests();
MessageLoopHelper.InitializeForUnitTests();
MessageLoopHelper.RegisterStubService();
project = WixBindingTestsHelper.CreateEmptyWixProject();
project.Name = "MySetup";
FileProjectItem item = new FileProjectItem(project, ItemType.Compile);

2
src/AddIns/BackendBindings/WixBinding/Test/PackageFiles/PackageFilesViewIsActiveTests.cs

@ -20,7 +20,7 @@ namespace WixBinding.Tests.PackageFiles @@ -20,7 +20,7 @@ namespace WixBinding.Tests.PackageFiles
public void Init()
{
SD.InitializeForUnitTests();
MessageLoopHelper.InitializeForUnitTests();
MessageLoopHelper.RegisterStubService();
workbench = new MockWorkbench();
project = WixBindingTestsHelper.CreateEmptyWixProject();
packageFilesView = new PackageFilesView(project, workbench);

2
src/AddIns/BackendBindings/WixBinding/Test/PackageFiles/PackageFilesViewTestFixture.cs

@ -29,7 +29,7 @@ namespace WixBinding.Tests.PackageFiles @@ -29,7 +29,7 @@ namespace WixBinding.Tests.PackageFiles
public void Init()
{
SD.InitializeForUnitTests();
MessageLoopHelper.InitializeForUnitTests();
MessageLoopHelper.RegisterStubService();
project = WixBindingTestsHelper.CreateEmptyWixProject();
mockWorkbench = new MockWorkbench();
mockPackageFilesControl = new MockWixPackageFilesControl();

2
src/AddIns/BackendBindings/WixBinding/Test/PackageFiles/SingleWixSourceFileInProjectTestFixture.cs

@ -24,7 +24,7 @@ namespace WixBinding.Tests.PackageFiles @@ -24,7 +24,7 @@ namespace WixBinding.Tests.PackageFiles
public void SetUpFixture()
{
SD.InitializeForUnitTests();
MessageLoopHelper.InitializeForUnitTests();
MessageLoopHelper.RegisterStubService();
WixProject p = WixBindingTestsHelper.CreateEmptyWixProject();
p.Name = "MySetup";
FileProjectItem item = new FileProjectItem(p, ItemType.Compile);

2
src/AddIns/BackendBindings/WixBinding/Test/PackageFiles/TargetDirectoryRefTestFixture.cs

@ -28,7 +28,7 @@ namespace WixBinding.Tests.PackageFiles @@ -28,7 +28,7 @@ namespace WixBinding.Tests.PackageFiles
public void SetUpFixture()
{
SD.InitializeForUnitTests();
MessageLoopHelper.InitializeForUnitTests();
MessageLoopHelper.RegisterStubService();
WixProject p = WixBindingTestsHelper.CreateEmptyWixProject();
p.Name = "MySetup";
FileProjectItem item = new FileProjectItem(p, ItemType.Compile);

2
src/AddIns/BackendBindings/WixBinding/Test/PackageFiles/TwoWixSourceFilesInProjectTestFixture.cs

@ -22,7 +22,7 @@ namespace WixBinding.Tests.PackageFiles @@ -22,7 +22,7 @@ namespace WixBinding.Tests.PackageFiles
public void SetUpFixture()
{
SD.InitializeForUnitTests();
MessageLoopHelper.InitializeForUnitTests();
MessageLoopHelper.RegisterStubService();
WixProject p = WixBindingTestsHelper.CreateEmptyWixProject();
p.Name = "MySetup";
FileProjectItem item = new FileProjectItem(p, ItemType.Compile);

2
src/AddIns/BackendBindings/WixBinding/Test/PackageFiles/TwoWixSourceFilesWithErrorsTestFixture.cs

@ -26,7 +26,7 @@ namespace WixBinding.Tests.PackageFiles @@ -26,7 +26,7 @@ namespace WixBinding.Tests.PackageFiles
public void SetUpFixture()
{
SD.InitializeForUnitTests();
MessageLoopHelper.InitializeForUnitTests();
MessageLoopHelper.RegisterStubService();
WixProject p = WixBindingTestsHelper.CreateEmptyWixProject();
p.Name = "MySetup";
FileProjectItem item = new FileProjectItem(p, ItemType.Compile);

2
src/AddIns/BackendBindings/WixBinding/Test/PackageFiles/UpdateRootDirectoryWithNewFilesTestFixtureBase.cs

@ -20,7 +20,7 @@ namespace WixBinding.Tests.PackageFiles @@ -20,7 +20,7 @@ namespace WixBinding.Tests.PackageFiles
public void Init()
{
SD.InitializeForUnitTests();
MessageLoopHelper.InitializeForUnitTests();
MessageLoopHelper.RegisterStubService();
textEditor = new MockTextEditor();
MockTextEditorViewContent viewContent = new MockTextEditorViewContent();
viewContent.TextEditor = textEditor;

2
src/AddIns/BackendBindings/WixBinding/Test/PackageFiles/WixSourceFileWithErrorsIgnoredTestFixture.cs

@ -26,7 +26,7 @@ namespace WixBinding.Tests.PackageFiles @@ -26,7 +26,7 @@ namespace WixBinding.Tests.PackageFiles
public void SetUpFixture()
{
SD.InitializeForUnitTests();
MessageLoopHelper.InitializeForUnitTests();
MessageLoopHelper.RegisterStubService();
WixProject p = WixBindingTestsHelper.CreateEmptyWixProject();
p.Name = "MySetup";
FileProjectItem item = new FileProjectItem(p, ItemType.Compile);

2
src/AddIns/BackendBindings/WixBinding/Test/Project/AddWixExtensionTestFixture.cs

@ -25,7 +25,7 @@ namespace WixBinding.Tests.Project @@ -25,7 +25,7 @@ namespace WixBinding.Tests.Project
public void SetUpFixture()
{
SD.InitializeForUnitTests();
MessageLoopHelper.InitializeForUnitTests();
MessageLoopHelper.RegisterStubService();
string fileName1 = @"C:\Projects\Test\wixext\test.dll";
string fileName2 = @"C:\Projects\Test\mainext\main.dll";
project = WixBindingTestsHelper.CreateEmptyWixProject();

2
src/AddIns/BackendBindings/WixBinding/Test/Project/AddWixLibraryTestFixture.cs

@ -25,7 +25,7 @@ namespace WixBinding.Tests.Project @@ -25,7 +25,7 @@ namespace WixBinding.Tests.Project
public void SetUpFixture()
{
SD.InitializeForUnitTests();
MessageLoopHelper.InitializeForUnitTests();
MessageLoopHelper.RegisterStubService();
string fileName1 = @"C:\Projects\Test\wixlibs\test.wixlib";
string fileName2 = @"C:\Projects\Test\mainlibs\main.wixlib";
project = WixBindingTestsHelper.CreateEmptyWixProject();

2
src/AddIns/BackendBindings/WixBinding/Test/Project/CanCompileTests.cs

@ -23,7 +23,7 @@ namespace WixBinding.Tests.Project @@ -23,7 +23,7 @@ namespace WixBinding.Tests.Project
public void Init()
{
SD.InitializeForUnitTests();
MessageLoopHelper.InitializeForUnitTests();
MessageLoopHelper.RegisterStubService();
project = WixBindingTestsHelper.CreateEmptyWixProject();
}

2
src/AddIns/BackendBindings/WixBinding/Test/Project/CloneWixLibraryTests.cs

@ -20,7 +20,7 @@ namespace WixBinding.Tests.Project @@ -20,7 +20,7 @@ namespace WixBinding.Tests.Project
public void SetUp()
{
SD.InitializeForUnitTests();
MessageLoopHelper.InitializeForUnitTests();
MessageLoopHelper.RegisterStubService();
}
[Test]

6
src/AddIns/BackendBindings/WixBinding/Test/Project/CreateNewWixProjectObjectTestFixture.cs

@ -10,7 +10,9 @@ using ICSharpCode.SharpDevelop.Internal.Templates; @@ -10,7 +10,9 @@ using ICSharpCode.SharpDevelop.Internal.Templates;
using ICSharpCode.SharpDevelop.Project;
using ICSharpCode.WixBinding;
using Microsoft.Build.Construction;
using Microsoft.Build.Evaluation;
using NUnit.Framework;
using Rhino.Mocks;
using WixBinding.Tests.Utils;
namespace WixBinding.Tests.Project
@ -28,11 +30,11 @@ namespace WixBinding.Tests.Project @@ -28,11 +30,11 @@ namespace WixBinding.Tests.Project
public void SetUpFixture()
{
SD.InitializeForUnitTests();
MessageLoopHelper.InitializeForUnitTests();
MessageLoopHelper.RegisterStubService();
WixBindingTestsHelper.InitMSBuildEngine();
info = new ProjectCreateInformation();
info.Solution = new Solution(new MockProjectChangeWatcher());
info.Solution = MockSolution.Create();
info.ProjectName = "Test";
info.OutputProjectFileName = new FileName(@"C:\Projects\Test\Test.wixproj");
info.RootNamespace = "Test";

2
src/AddIns/BackendBindings/WixBinding/Test/Project/CreateWixProjectItemTests.cs

@ -69,7 +69,7 @@ namespace WixBinding.Tests.Project @@ -69,7 +69,7 @@ namespace WixBinding.Tests.Project
public void SetUp()
{
SD.InitializeForUnitTests();
MessageLoopHelper.InitializeForUnitTests();
MessageLoopHelper.RegisterStubService();
}
[Test]

2
src/AddIns/BackendBindings/WixBinding/Test/Project/GetPreprocessorVariableValueTests.cs

@ -21,7 +21,7 @@ namespace WixBinding.Tests.Project @@ -21,7 +21,7 @@ namespace WixBinding.Tests.Project
public void SetUp()
{
SD.InitializeForUnitTests();
MessageLoopHelper.InitializeForUnitTests();
MessageLoopHelper.RegisterStubService();
}
[Test]

2
src/AddIns/BackendBindings/WixBinding/Test/Project/GetWixExtensionsTestFixture.cs

@ -22,7 +22,7 @@ namespace WixBinding.Tests.Project @@ -22,7 +22,7 @@ namespace WixBinding.Tests.Project
public void SetUpFixture()
{
SD.InitializeForUnitTests();
MessageLoopHelper.InitializeForUnitTests();
MessageLoopHelper.RegisterStubService();
WixProject p = WixBindingTestsHelper.CreateEmptyWixProject();
WixExtensionProjectItem compilerItem = new WixExtensionProjectItem(p);

2
src/AddIns/BackendBindings/WixBinding/Test/Project/GetWixFileProjectItemsTestFixture.cs

@ -25,7 +25,7 @@ namespace WixBinding.Tests.Project @@ -25,7 +25,7 @@ namespace WixBinding.Tests.Project
public void SetUpFixture()
{
SD.InitializeForUnitTests();
MessageLoopHelper.InitializeForUnitTests();
MessageLoopHelper.RegisterStubService();
WixProject p = WixBindingTestsHelper.CreateEmptyWixProject();
FileProjectItem item = new FileProjectItem(p, ItemType.None);

2
src/AddIns/BackendBindings/WixBinding/Test/Project/GetWixSourceFileProjectItemsTestFixture.cs

@ -25,7 +25,7 @@ namespace WixBinding.Tests.Project @@ -25,7 +25,7 @@ namespace WixBinding.Tests.Project
public void SetUpFixture()
{
SD.InitializeForUnitTests();
MessageLoopHelper.InitializeForUnitTests();
MessageLoopHelper.RegisterStubService();
WixProject p = WixBindingTestsHelper.CreateEmptyWixProject();
FileProjectItem item = new FileProjectItem(p, ItemType.None);

6
src/AddIns/BackendBindings/WixBinding/Test/Project/WixBuilderCannotBuildNonWixProjectTestFixture.cs

@ -25,16 +25,16 @@ namespace WixBinding.Tests.Project @@ -25,16 +25,16 @@ namespace WixBinding.Tests.Project
public void SetUpFixture()
{
SD.InitializeForUnitTests();
MessageLoopHelper.InitializeForUnitTests();
MessageLoopHelper.RegisterStubService();
wixNodeBuilder = new WixProjectNodeBuilder();
project = new MSBuildBasedProject(
new ProjectCreateInformation {
OutputProjectFileName = new FileName(@"C:\Projects\Test\test.csproj"),
Solution = new Solution(new MockProjectChangeWatcher()),
Solution = MockSolution.Create(),
ProjectName = "test"
}
);
project.IdGuid = "FFFFFFFF-FFFF-FFFF-FFFF-FFFFFFFFFFFF";
project.IdGuid = Guid.Parse("FFFFFFFF-FFFF-FFFF-FFFF-FFFFFFFFFFFF");
}
[Test]

2
src/AddIns/BackendBindings/WixBinding/Test/Project/WixInstallerPathTests.cs

@ -21,7 +21,7 @@ namespace WixBinding.Tests.Project @@ -21,7 +21,7 @@ namespace WixBinding.Tests.Project
public void SetUp()
{
SD.InitializeForUnitTests();
MessageLoopHelper.InitializeForUnitTests();
MessageLoopHelper.RegisterStubService();
}
[Test]

2
src/AddIns/BackendBindings/WixBinding/Test/Project/WixNodeBuilderCanBuildWixProjectTestFixture.cs

@ -22,7 +22,7 @@ namespace WixBinding.Tests.Project @@ -22,7 +22,7 @@ namespace WixBinding.Tests.Project
public void SetUp()
{
SD.InitializeForUnitTests();
MessageLoopHelper.InitializeForUnitTests();
MessageLoopHelper.RegisterStubService();
}
[Test]

2
src/AddIns/BackendBindings/WixBinding/Test/Project/WixProjectTests.cs

@ -18,7 +18,7 @@ namespace WixBinding.Tests.Project @@ -18,7 +18,7 @@ namespace WixBinding.Tests.Project
void CreateProject()
{
SD.InitializeForUnitTests();
MessageLoopHelper.InitializeForUnitTests();
MessageLoopHelper.RegisterStubService();
project = WixBindingTestsHelper.CreateEmptyWixProject();
}

3
src/AddIns/BackendBindings/WixBinding/Test/Utils/MessageLoopHelper.cs

@ -9,10 +9,9 @@ namespace WixBinding.Tests.Utils @@ -9,10 +9,9 @@ namespace WixBinding.Tests.Utils
{
public static class MessageLoopHelper
{
public static void InitializeForUnitTests()
public static void RegisterStubService()
{
IMessageLoop messageLoop = MockRepository.GenerateStub<IMessageLoop>();
SD.Services.RemoveService(typeof(IMessageLoop));
SD.Services.AddService(typeof(IMessageLoop), messageLoop);
}
}

28
src/AddIns/BackendBindings/WixBinding/Test/Utils/MockSolution.cs

@ -0,0 +1,28 @@ @@ -0,0 +1,28 @@
/*
* Created by SharpDevelop.
* User: Daniel
* Date: 2/27/2013
* Time: 00:40
*
* To change this template use Tools | Options | Coding | Edit Standard Headers.
*/
using System;
using ICSharpCode.SharpDevelop.Project;
using Microsoft.Build.Evaluation;
using Rhino.Mocks;
namespace WixBinding.Tests.Utils
{
/// <summary>
/// Description of MockSolution.
/// </summary>
public class MockSolution
{
public static ISolution Create()
{
ISolution solution = MockRepository.GenerateStrictMock<ISolution>();
solution.Stub(s => s.MSBuildProjectCollection).Return(new ProjectCollection());
return solution;
}
}
}

1
src/AddIns/BackendBindings/WixBinding/Test/Utils/ResourceServiceHelper.cs

@ -11,7 +11,6 @@ namespace WixBinding.Tests.Utils @@ -11,7 +11,6 @@ namespace WixBinding.Tests.Utils
{
public static void InitializeForUnitTests()
{
SD.Services.RemoveService(typeof(IResourceService));
var propertyService = SD.Services.GetService(typeof(IPropertyService)) as IPropertyService;
SD.Services.AddService(typeof(IResourceService), new ResourceServiceImpl("", propertyService));
}

2
src/AddIns/BackendBindings/WixBinding/Test/Utils/Tests/MockFormsDesignerViewTests.cs

@ -18,7 +18,7 @@ namespace WixBinding.Tests.Utils.Tests @@ -18,7 +18,7 @@ namespace WixBinding.Tests.Utils.Tests
public void Init()
{
SD.InitializeForUnitTests();
MessageLoopHelper.InitializeForUnitTests();
MessageLoopHelper.RegisterStubService();
view = new MockFormsDesignerView();
}

2
src/AddIns/BackendBindings/WixBinding/Test/Utils/Tests/MockPackageFilesViewFactoryTests.cs

@ -21,7 +21,7 @@ namespace WixBinding.Tests.Utils.Tests @@ -21,7 +21,7 @@ namespace WixBinding.Tests.Utils.Tests
public void Init()
{
SD.InitializeForUnitTests();
MessageLoopHelper.InitializeForUnitTests();
MessageLoopHelper.RegisterStubService();
project = WixBindingTestsHelper.CreateEmptyWixProject();
factory = new MockPackageFilesViewFactory();
workbench = new MockWorkbench();

2
src/AddIns/BackendBindings/WixBinding/Test/Utils/Tests/MockTextEditorViewContentTests.cs

@ -18,7 +18,7 @@ namespace WixBinding.Tests.Utils.Tests @@ -18,7 +18,7 @@ namespace WixBinding.Tests.Utils.Tests
public void Init()
{
SD.InitializeForUnitTests();
MessageLoopHelper.InitializeForUnitTests();
MessageLoopHelper.RegisterStubService();
view = new MockTextEditorViewContent();
}

2
src/AddIns/BackendBindings/WixBinding/Test/Utils/Tests/MockViewContentTests.cs

@ -17,7 +17,7 @@ namespace WixBinding.Tests.Utils.Tests @@ -17,7 +17,7 @@ namespace WixBinding.Tests.Utils.Tests
public void Init()
{
SD.InitializeForUnitTests();
MessageLoopHelper.InitializeForUnitTests();
MessageLoopHelper.RegisterStubService();
view = new MockViewContent();
}

2
src/AddIns/BackendBindings/WixBinding/Test/Utils/Tests/MockWixPackageFilesControlTests.cs

@ -17,7 +17,7 @@ namespace WixBinding.Tests.Utils.Tests @@ -17,7 +17,7 @@ namespace WixBinding.Tests.Utils.Tests
public void Init()
{
SD.InitializeForUnitTests();
MessageLoopHelper.InitializeForUnitTests();
MessageLoopHelper.RegisterStubService();
control = new MockWixPackageFilesControl();
}

2
src/AddIns/BackendBindings/WixBinding/Test/Utils/Tests/MockWorkbenchTests.cs

@ -17,7 +17,7 @@ namespace WixBinding.Tests.Utils.Tests @@ -17,7 +17,7 @@ namespace WixBinding.Tests.Utils.Tests
public void Init()
{
SD.InitializeForUnitTests();
MessageLoopHelper.InitializeForUnitTests();
MessageLoopHelper.RegisterStubService();
workbench = new MockWorkbench();
}

2
src/AddIns/BackendBindings/WixBinding/Test/Utils/Tests/WixBindingTestsHelperTests.cs

@ -19,7 +19,7 @@ namespace WixBinding.Tests.Utils.Tests @@ -19,7 +19,7 @@ namespace WixBinding.Tests.Utils.Tests
public void Init()
{
SD.InitializeForUnitTests();
MessageLoopHelper.InitializeForUnitTests();
MessageLoopHelper.RegisterStubService();
project = WixBindingTestsHelper.CreateEmptyWixProject();
}

5
src/AddIns/BackendBindings/WixBinding/Test/Utils/WixBindingTestsHelper.cs

@ -11,6 +11,8 @@ using ICSharpCode.SharpDevelop; @@ -11,6 +11,8 @@ using ICSharpCode.SharpDevelop;
using ICSharpCode.SharpDevelop.Internal.Templates;
using ICSharpCode.SharpDevelop.Project;
using ICSharpCode.WixBinding;
using Microsoft.Build.Evaluation;
using Rhino.Mocks;
namespace WixBinding.Tests.Utils
{
@ -44,7 +46,8 @@ namespace WixBinding.Tests.Utils @@ -44,7 +46,8 @@ namespace WixBinding.Tests.Utils
// create the project.
ProjectCreateInformation info = new ProjectCreateInformation();
info.Solution = new Solution(new MockProjectChangeWatcher());
info.Solution = MockRepository.GenerateStub<ISolution>();
info.Solution.Stub(s => s.MSBuildProjectCollection).Return(new ProjectCollection());
info.ProjectName = "Test";
info.OutputProjectFileName = new FileName(@"C:\Projects\Test\Test.wixproj");

1
src/AddIns/BackendBindings/WixBinding/Test/WixBinding.Tests.csproj

@ -119,6 +119,7 @@ @@ -119,6 +119,7 @@
<Compile Include="Utils\MockFormsDesignerView.cs" />
<Compile Include="Utils\MockOpenedFile.cs" />
<Compile Include="Utils\MockPackageFilesViewFactory.cs" />
<Compile Include="Utils\MockSolution.cs" />
<Compile Include="Utils\MockTextEditor.cs" />
<Compile Include="Utils\MockTextEditorOptions.cs" />
<Compile Include="Utils\MockTextFileReader.cs" />

4
src/AddIns/BackendBindings/XamlBinding/XamlBinding/XamlSymbolSearch.cs

@ -38,9 +38,7 @@ namespace ICSharpCode.XamlBinding @@ -38,9 +38,7 @@ namespace ICSharpCode.XamlBinding
this.entity = entity;
compilation = SD.ParserService.GetCompilation(project);
interestingFileNames = new List<FileName>();
foreach (var item in project.ParentSolution.SolutionFolderContainers.Select(f => f.SolutionItems).SelectMany(si => si.Items).Where(i => ".xaml".Equals(Path.GetExtension(i.Location), StringComparison.OrdinalIgnoreCase)))
interestingFileNames.Add(new FileName(Path.Combine(project.ParentSolution.Directory, item.Location)));
foreach (var item in project.ParentSolution.Projects.SelectMany(p => p.Items).OfType<FileProjectItem>().Where(i => ".xaml".Equals(Path.GetExtension(i.FileName), StringComparison.OrdinalIgnoreCase)))
foreach (var item in project.ParentSolution.Projects.SelectMany(p => p.Items).OfType<FileProjectItem>().Where(i => i.FileName.EndsWith(".xaml", StringComparison.OrdinalIgnoreCase)))
interestingFileNames.Add(new FileName(item.FileName));
workAmount = interestingFileNames.Count;
workAmountInverse = 1.0 / workAmount;

4
src/AddIns/Debugger/Debugger.AddIn/Pads/WatchPad.cs

@ -66,7 +66,7 @@ namespace ICSharpCode.SharpDevelop.Gui.Pads @@ -66,7 +66,7 @@ namespace ICSharpCode.SharpDevelop.Gui.Pads
void LoadNodes()
{
if (ProjectService.OpenSolution != null) {
var props = ProjectService.OpenSolution.Preferences.Properties.NestedProperties("Watches");
var props = ProjectService.OpenSolution.Preferences.NestedProperties("Watches");
foreach (var key in props.Keys) {
this.Items.Add(new TreeNode(props.Get(key, ""), () => null).ToSharpTreeNode());
}
@ -77,7 +77,7 @@ namespace ICSharpCode.SharpDevelop.Gui.Pads @@ -77,7 +77,7 @@ namespace ICSharpCode.SharpDevelop.Gui.Pads
{
if (ProjectService.OpenSolution != null) {
var props = new Properties();
ProjectService.OpenSolution.Preferences.Properties.SetNestedProperties("Watches", props);
ProjectService.OpenSolution.Preferences.SetNestedProperties("Watches", props);
foreach(var node in this.Items.OfType<TreeNode>()) {
props.Set(node.Name, (object)null);
}

5
src/AddIns/DisplayBindings/WpfDesign/WpfDesign.AddIn/Src/AbstractEventHandlerService.cs

@ -32,10 +32,7 @@ namespace ICSharpCode.WpfDesign.AddIn @@ -32,10 +32,7 @@ namespace ICSharpCode.WpfDesign.AddIn
IProject FindProjectContainingFile()
{
if (ProjectService.OpenSolution != null) {
return ProjectService.OpenSolution.FindProjectContainingFile(viewContent.PrimaryFileName);
}
return null;
return SD.ProjectService.FindProjectContainingFile(viewContent.PrimaryFileName);
}
protected IType GetDesignedClass(ICompilation compilation)

5
src/AddIns/DisplayBindings/WpfDesign/WpfDesign.AddIn/Src/MyTypeFinder.cs

@ -74,10 +74,7 @@ namespace ICSharpCode.WpfDesign.AddIn @@ -74,10 +74,7 @@ namespace ICSharpCode.WpfDesign.AddIn
internal static IProject GetProject(OpenedFile file)
{
if (ProjectService.OpenSolution != null && file != null) {
return ProjectService.OpenSolution.FindProjectContainingFile(file.FileName);
}
return null;
return SD.ProjectService.FindProjectContainingFile(file.FileName);
}
}
}

8
src/AddIns/Misc/PackageManagement/Project/Src/EnvDTE/SolutionConfiguration.cs

@ -8,15 +8,15 @@ namespace ICSharpCode.PackageManagement.EnvDTE @@ -8,15 +8,15 @@ namespace ICSharpCode.PackageManagement.EnvDTE
{
public class SolutionConfiguration : MarshalByRefObject, global::EnvDTE.SolutionConfiguration
{
SolutionPreferences preferences;
ISolution solution;
public SolutionConfiguration(SolutionPreferences preferences)
public SolutionConfiguration(ISolution solution)
{
this.preferences = preferences;
this.solution = solution;
}
public string Name {
get { return preferences.ActiveConfiguration; }
get { return solution.ActiveConfiguration.Configuration; }
}
}
}

5
src/AddIns/Misc/PackageManagement/Project/Src/MSBuildBasedProjectExtensions.cs

@ -8,12 +8,9 @@ namespace ICSharpCode.PackageManagement @@ -8,12 +8,9 @@ namespace ICSharpCode.PackageManagement
{
public static class MSBuildBasedProjectExtensions
{
public static readonly Guid WebApplication = Guid.Parse(ProjectTypeGuids.WebApplication);
public static readonly Guid WebSite = Guid.Parse(ProjectTypeGuids.WebSite);
public static bool IsWebProject(this MSBuildBasedProject project)
{
return project.HasProjectType(WebApplication) || project.HasProjectType(WebSite);
return project.HasProjectType(ProjectTypeGuids.WebApplication) || project.HasProjectType(ProjectTypeGuids.WebSite);
}
}
}

1
src/AddIns/Misc/PackageManagement/Test/PackageManagement.Tests.csproj

@ -38,6 +38,7 @@ @@ -38,6 +38,7 @@
<DefineConstants>TRACE</DefineConstants>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.Build" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="NuGet.Console.Types">
<HintPath>..\RequiredLibraries\NuGet.Console.Types.dll</HintPath>

30
src/AddIns/Misc/PackageManagement/Test/Src/Helpers/ProjectHelper.cs

@ -2,15 +2,29 @@ @@ -2,15 +2,29 @@
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
using System;
using System.Collections.Generic;
using ICSharpCode.Core;
using ICSharpCode.SharpDevelop;
using ICSharpCode.SharpDevelop.Dom;
using ICSharpCode.SharpDevelop.Internal.Templates;
using ICSharpCode.SharpDevelop.Project;
using Rhino.Mocks;
namespace PackageManagement.Tests.Helpers
{
public static class ProjectHelper
{
public static ISolution CreateSolution()
{
SD.InitializeForUnitTests();
MessageLoopHelper.InitializeForUnitTests();
ISolution solution = MockRepository.GenerateStrictMock<ISolution>();
solution.Stub(s => s.MSBuildProjectCollection).Return(new Microsoft.Build.Evaluation.ProjectCollection());
solution.Stub(s => s.Projects).Return(new SimpleModelCollection<IProject>());
//solution.Stub(s => s.FileName).Return(FileName.Create(@"d:\projects\Test\TestSolution.sln"));
return solution;
}
public static TestableProject CreateTestProject()
{
return CreateTestProject("TestProject");
@ -18,8 +32,7 @@ namespace PackageManagement.Tests.Helpers @@ -18,8 +32,7 @@ namespace PackageManagement.Tests.Helpers
public static TestableProject CreateTestProject(string name)
{
ISolution solution = new Solution(new MockProjectChangeWatcher());
solution.FileName = @"d:\projects\Test\TestSolution.sln";
ISolution solution = CreateSolution();
return CreateTestProject(solution, name);
}
@ -27,20 +40,17 @@ namespace PackageManagement.Tests.Helpers @@ -27,20 +40,17 @@ namespace PackageManagement.Tests.Helpers
public static TestableProject CreateTestProject(
ISolution parentSolution,
string name,
string fileName = @"d:\projects\Test\TestProject\TestProject.csproj")
string fileName = null)
{
SD.InitializeForUnitTests();
MessageLoopHelper.InitializeForUnitTests();
ProjectCreateInformation createInfo = new ProjectCreateInformation();
createInfo.Solution = parentSolution;
createInfo.ProjectName = name;
createInfo.SolutionPath = @"d:\projects\Test";
createInfo.ProjectBasePath = @"d:\projects\Test\TestProject";
createInfo.OutputProjectFileName = new FileName(fileName);
createInfo.OutputProjectFileName = new FileName(fileName ?? (@"d:\projects\Test\TestProject\" + name + ".csproj"));
var project = new TestableProject(createInfo);
project.Parent = parentSolution;
parentSolution.AddFolder(project);
((ICollection<IProject>)parentSolution.Projects).Add(project);
return project;
}
@ -68,9 +78,9 @@ namespace PackageManagement.Tests.Helpers @@ -68,9 +78,9 @@ namespace PackageManagement.Tests.Helpers
AddProjectType(project, ProjectTypeGuids.WebSite);
}
public static void AddProjectType(MSBuildBasedProject project, string guidText)
public static void AddProjectType(MSBuildBasedProject project, Guid guid)
{
project.AddProjectType(Guid.Parse(guidText));
project.AddProjectType(guid);
}
public static void AddReference(MSBuildBasedProject project, string referenceName)

6
src/AddIns/Misc/PackageManagement/Test/Src/PackageManagementSelectedProjectsTests.cs

@ -40,12 +40,10 @@ namespace PackageManagement.Tests @@ -40,12 +40,10 @@ namespace PackageManagement.Tests
List<IProject> AddSolutionWithTwoProjectsToProjectService()
{
TestableProject project1 = ProjectHelper.CreateTestProject("Test1");
ISolution solution = ProjectHelper.CreateSolution();
TestableProject project1 = ProjectHelper.CreateTestProject(solution, "Test1");
TestableProject project2 = ProjectHelper.CreateTestProject("Test2");
ISolution solution = project1.ParentSolution;
project2.Parent = solution;
fakeSolution.FakeMSBuildProjects.Add(project1);
fakeSolution.FakeMSBuildProjects.Add(project2);

10
src/AddIns/Misc/PackageManagement/Test/Src/PackageManagementSolutionTests.cs

@ -5,11 +5,13 @@ using System; @@ -5,11 +5,13 @@ using System;
using System.Collections.Generic;
using System.Linq;
using ICSharpCode.Core;
using ICSharpCode.PackageManagement;
using ICSharpCode.PackageManagement.Design;
using ICSharpCode.SharpDevelop.Project;
using NuGet;
using NUnit.Framework;
using Rhino.Mocks;
using PackageManagement.Tests.Helpers;
namespace PackageManagement.Tests
@ -326,7 +328,7 @@ namespace PackageManagement.Tests @@ -326,7 +328,7 @@ namespace PackageManagement.Tests
public void IsOpen_SolutionIsOpen_ReturnsTrue()
{
CreateSolution();
fakeProjectService.OpenSolution = new Solution(new MockProjectChangeWatcher());
fakeProjectService.OpenSolution = MockRepository.GenerateStrictMock<ISolution>();
bool open = solution.IsOpen;
@ -374,12 +376,12 @@ namespace PackageManagement.Tests @@ -374,12 +376,12 @@ namespace PackageManagement.Tests
public void FileName_SolutionHasFileName_ReturnsSolutionFileName()
{
CreateSolution();
var solution = new Solution(new MockProjectChangeWatcher());
var solution = MockRepository.GenerateStrictMock<ISolution>();
string expectedFileName = @"d:\projects\myproject\Project.sln";
solution.FileName = expectedFileName;
solution.Stub(s => s.FileName).Return(FileName.Create(expectedFileName));
fakeProjectService.OpenSolution = solution;
string fileName = solution.FileName;
string fileName = this.solution.FileName;
Assert.AreEqual(expectedFileName, fileName);
}

17
src/AddIns/Misc/PackageManagement/Test/Src/Scripting/PackageManagementConsoleViewModelTests.cs

@ -11,6 +11,7 @@ using ICSharpCode.PackageManagement.Scripting; @@ -11,6 +11,7 @@ using ICSharpCode.PackageManagement.Scripting;
using ICSharpCode.SharpDevelop.Project;
using NuGet;
using NUnit.Framework;
using Rhino.Mocks;
using PackageManagement.Tests.Helpers;
namespace PackageManagement.Tests.Scripting
@ -109,10 +110,7 @@ namespace PackageManagement.Tests.Scripting @@ -109,10 +110,7 @@ namespace PackageManagement.Tests.Scripting
ISolution CreateSolutionWithOneProject()
{
TestableProject project = ProjectHelper.CreateTestProject();
ISolution solution = project.ParentSolution;
solution.AddFolder(project);
return solution;
return project.ParentSolution;
}
PackageSource AddOnePackageSourceAndRemoveAnyExistingPackageSources()
@ -149,7 +147,7 @@ namespace PackageManagement.Tests.Scripting @@ -149,7 +147,7 @@ namespace PackageManagement.Tests.Scripting
ISolution CreateViewModelWithEmptySolutionOpen()
{
CreateConsoleHost();
var solution = new Solution(new MockProjectChangeWatcher());
var solution = ProjectHelper.CreateSolution();
projectService = new FakePackageManagementProjectService();
projectService.OpenSolution = solution;
CreateViewModel(consoleHost, projectService);
@ -158,8 +156,7 @@ namespace PackageManagement.Tests.Scripting @@ -158,8 +156,7 @@ namespace PackageManagement.Tests.Scripting
TestableProject AddProjectToSolution(ISolution solution)
{
var project = ProjectHelper.CreateTestProject();
solution.AddFolder(project);
var project = ProjectHelper.CreateTestProject(solution, "TestProject");
return project;
}
@ -178,7 +175,7 @@ namespace PackageManagement.Tests.Scripting @@ -178,7 +175,7 @@ namespace PackageManagement.Tests.Scripting
IProject RemoveProjectFromSolution(ISolution solution)
{
var project = solution.Projects.FirstOrDefault();
solution.RemoveFolder(project);
((ICollection<IProject>)solution.Projects).Remove(project);
return project;
}
@ -312,7 +309,7 @@ namespace PackageManagement.Tests.Scripting @@ -312,7 +309,7 @@ namespace PackageManagement.Tests.Scripting
{
CreateConsoleHost();
projectService = new FakePackageManagementProjectService();
var solution = new Solution(new MockProjectChangeWatcher());
var solution = ProjectHelper.CreateSolution();
projectService.OpenSolution = solution;
Assert.DoesNotThrow(() => CreateViewModel(consoleHost, projectService));
@ -443,7 +440,7 @@ namespace PackageManagement.Tests.Scripting @@ -443,7 +440,7 @@ namespace PackageManagement.Tests.Scripting
public void Projects_SolutionFolderRemovedFromSolution_ProjectListIsUnchanged()
{
var solution = CreateViewModelWithOneProjectOpen();
var solutionFolder = new SolutionFolder("Test", "Location", "Guid");
var solutionFolder = MockRepository.GenerateStrictMock<ISolutionFolder>();
projectService.FireSolutionFolderRemoved(solutionFolder);
int count = viewModel.Projects.Count;

6
src/AddIns/Misc/PackageManagement/Test/Src/Scripting/PowerShellWorkingDirectoryTests.cs

@ -2,10 +2,12 @@ @@ -2,10 +2,12 @@
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
using System;
using ICSharpCode.Core;
using ICSharpCode.PackageManagement.Design;
using ICSharpCode.PackageManagement.Scripting;
using ICSharpCode.SharpDevelop.Project;
using NUnit.Framework;
using Rhino.Mocks;
using PackageManagement.Tests.Helpers;
namespace PackageManagement.Tests.Scripting
@ -39,8 +41,8 @@ namespace PackageManagement.Tests.Scripting @@ -39,8 +41,8 @@ namespace PackageManagement.Tests.Scripting
public void GetWorkingDirectory_SolutionOpen_ReturnsSolutionDirectory()
{
CreateWorkingDirectory();
var solution = new Solution(new MockProjectChangeWatcher());
solution.FileName = @"d:\projects\MyProject\myproject.sln";
var solution = MockRepository.GenerateStrictMock<ISolution>();
solution.Stub(s => s.Directory).Return(DirectoryName.Create(@"d:\projects\MyProject"));
fakeProjectService.OpenSolution = solution;
string directory = workingDirectory.GetWorkingDirectory();

8
src/AddIns/Misc/PackageManagement/Test/Src/SelectedProjectsForInstalledPackagesTests.cs

@ -31,11 +31,9 @@ namespace PackageManagement.Tests @@ -31,11 +31,9 @@ namespace PackageManagement.Tests
List<IProject> AddSolutionWithTwoProjectsToProjectService()
{
TestableProject project1 = ProjectHelper.CreateTestProject("Test1");
TestableProject project2 = ProjectHelper.CreateTestProject("Test2");
ISolution solution = project1.ParentSolution;
project2.Parent = solution;
ISolution solution = ProjectHelper.CreateSolution();
TestableProject project1 = ProjectHelper.CreateTestProject(solution, "Test1");
TestableProject project2 = ProjectHelper.CreateTestProject(solution, "Test2");
fakeSolution.FakeMSBuildProjects.Add(project1);
fakeSolution.FakeMSBuildProjects.Add(project2);

8
src/AddIns/Misc/PackageManagement/Test/Src/SelectedProjectsForUpdatedPackagesTests.cs

@ -31,11 +31,9 @@ namespace PackageManagement.Tests @@ -31,11 +31,9 @@ namespace PackageManagement.Tests
List<IProject> AddSolutionWithTwoProjectsToProjectService(string projectName1, string projectName2)
{
TestableProject project1 = ProjectHelper.CreateTestProject(projectName1);
TestableProject project2 = ProjectHelper.CreateTestProject(projectName2);
ISolution solution = project1.ParentSolution;
project2.Parent = solution;
ISolution solution = ProjectHelper.CreateSolution();
TestableProject project1 = ProjectHelper.CreateTestProject(solution, projectName1);
TestableProject project2 = ProjectHelper.CreateTestProject(solution, projectName2);
fakeSolution.FakeMSBuildProjects.Add(project1);
fakeSolution.FakeMSBuildProjects.Add(project2);

5
src/AddIns/Misc/PackageManagement/Test/Src/SharpDevelopPackageManagerFactoryTests.cs

@ -8,6 +8,7 @@ using ICSharpCode.PackageManagement.Design; @@ -8,6 +8,7 @@ using ICSharpCode.PackageManagement.Design;
using ICSharpCode.SharpDevelop.Project;
using NuGet;
using NUnit.Framework;
using Rhino.Mocks;
using PackageManagement.Tests.Helpers;
namespace PackageManagement.Tests
@ -34,6 +35,7 @@ namespace PackageManagement.Tests @@ -34,6 +35,7 @@ namespace PackageManagement.Tests
void CreateTestProject()
{
testProject = ProjectHelper.CreateTestProject();
testProject.ParentSolution.Stub(s => s.Directory).Return(DirectoryName.Create(@"c:\projects\MyProject\"));
}
void CreatePackageManager()
@ -58,7 +60,6 @@ namespace PackageManagement.Tests @@ -58,7 +60,6 @@ namespace PackageManagement.Tests
{
CreateFactory();
CreateTestProject();
testProject.ParentSolution.FileName = @"c:\projects\MyProject\MySolution.sln";
options.PackagesDirectory = "MyPackages";
CreatePackageManager();
@ -72,7 +73,6 @@ namespace PackageManagement.Tests @@ -72,7 +73,6 @@ namespace PackageManagement.Tests
{
CreateFactory();
CreateTestProject();
testProject.ParentSolution.FileName = @"c:\projects\MyProject\MySolution.sln";
options.PackagesDirectory = "MyPackages";
CreatePackageManager();
@ -102,7 +102,6 @@ namespace PackageManagement.Tests @@ -102,7 +102,6 @@ namespace PackageManagement.Tests
{
CreateFactory();
CreateTestProject();
testProject.ParentSolution.FileName = @"c:\projects\MyProject\MySolution.sln";
options.PackagesDirectory = "packages";
CreatePackageManager();

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save