diff options
author | Lluis Sanchez <llsan@microsoft.com> | 2019-02-16 14:57:59 +0300 |
---|---|---|
committer | Lluis Sanchez <llsan@microsoft.com> | 2019-02-18 15:14:40 +0300 |
commit | 5e2eaefe08fc245084cac50f8e22ae032deb738d (patch) | |
tree | 17b5d5d4ed30cf846fe2f105139621dcbf44edbb /main/src/core/MonoDevelop.TextEditor.Tests | |
parent | 251ffed7b91e9a6fa937c42d33684c65a65683e2 (diff) |
Moved the text editor to the new document/view architecture
Diffstat (limited to 'main/src/core/MonoDevelop.TextEditor.Tests')
2 files changed, 8 insertions, 54 deletions
diff --git a/main/src/core/MonoDevelop.TextEditor.Tests/Mono.TextEditor.Tests.DefaultEditActions/TextEditorTestBase.cs b/main/src/core/MonoDevelop.TextEditor.Tests/Mono.TextEditor.Tests.DefaultEditActions/TextEditorTestBase.cs index 17bede7ab0..5b52638e24 100644 --- a/main/src/core/MonoDevelop.TextEditor.Tests/Mono.TextEditor.Tests.DefaultEditActions/TextEditorTestBase.cs +++ b/main/src/core/MonoDevelop.TextEditor.Tests/Mono.TextEditor.Tests.DefaultEditActions/TextEditorTestBase.cs @@ -33,64 +33,14 @@ using MonoDevelop.Core.Assemblies; using MonoDevelop.Ide; using MonoDevelop.Ide.Editor; using NUnit.Framework; +using UnitTests; +using MonoDevelop.Ide.Fonts; namespace Mono.TextEditor.Tests { - class TextEditorTestBase + [RequireService (typeof(FontService))] + class TextEditorTestBase: TestBase { - static bool firstRun = true; - static string rootDir; - - public static string TestsRootDir { - get { - if (rootDir == null) { - rootDir = Path.GetDirectoryName (typeof (TextEditorTestBase).Assembly.Location); - rootDir = Path.Combine (Path.Combine (rootDir, ".."), ".."); - rootDir = Path.GetFullPath (Path.Combine (rootDir, "tests")); - } - return rootDir; - } - } - - [TestFixtureSetUp] - public virtual void Setup () - { - if (firstRun) { - string rootDir = Path.Combine (TestsRootDir, "config"); - try { - firstRun = false; - InternalSetup (rootDir); - } catch (Exception) { - // if we encounter an error, try to re create the configuration directory - // (This takes much time, therfore it's only done when initialization fails) - try { - if (Directory.Exists (rootDir)) - Directory.Delete (rootDir, true); - InternalSetup (rootDir); - } catch (Exception) { - } - } - } - } - - protected virtual void InternalSetup (string rootDir) - { - Environment.SetEnvironmentVariable ("MONO_ADDINS_REGISTRY", rootDir); - Environment.SetEnvironmentVariable ("XDG_CONFIG_HOME", rootDir); - Runtime.Initialize (true); - Gtk.Application.Init (); - DesktopService.Initialize (); - global::MonoDevelop.Projects.Services.ProjectService.DefaultTargetFramework - = Runtime.SystemAssemblyService.GetTargetFramework (TargetFrameworkMoniker.NET_4_0); - } - - [TestFixtureTearDown] - public virtual void TearDown () - { - } - - - public static TextEditorData Create (string content, ITextEditorOptions options = null, string mimeType = null) { var data = new TextEditorData (); diff --git a/main/src/core/MonoDevelop.TextEditor.Tests/MonoDevelop.TextEditor.Tests.csproj b/main/src/core/MonoDevelop.TextEditor.Tests/MonoDevelop.TextEditor.Tests.csproj index de07be4b92..6ea94c3007 100644 --- a/main/src/core/MonoDevelop.TextEditor.Tests/MonoDevelop.TextEditor.Tests.csproj +++ b/main/src/core/MonoDevelop.TextEditor.Tests/MonoDevelop.TextEditor.Tests.csproj @@ -79,6 +79,10 @@ <Name>MonoDevelop.Ide</Name> <Private>False</Private> </ProjectReference> + <ProjectReference Include="..\..\..\tests\UnitTests\UnitTests.csproj"> + <Project>{1497D0A8-AFF1-4938-BC22-BE79B358BA5B}</Project> + <Name>UnitTests</Name> + </ProjectReference> </ItemGroup> <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> </Project>
\ No newline at end of file |