From 37c18e066081a10a16787f844d3f5eaf97253b71 Mon Sep 17 00:00:00 2001 From: Daniel Grunwald Date: Sat, 4 Aug 2007 12:47:55 +0000 Subject: [PATCH] Fixed unit tests when .NET FX 3.5 is installed - do not rely on the order in which Reflection returns methods. git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/branches/2.1@2624 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61 --- data/templates/file/CSharp/CSharp.UnitTest.xft | 2 +- .../Src/Internal/Templates/File/FileTemplate.cs | 15 +++++---------- .../Test/CollectionClassOverridesTestFixture.cs | 3 +++ 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/data/templates/file/CSharp/CSharp.UnitTest.xft b/data/templates/file/CSharp/CSharp.UnitTest.xft index 681585b541..3ba792369c 100644 --- a/data/templates/file/CSharp/CSharp.UnitTest.xft +++ b/data/templates/file/CSharp/CSharp.UnitTest.xft @@ -50,9 +50,9 @@ #if TEST <% } %> +using System; using NUnit.Framework; using NUnit.Framework.SyntaxHelpers; -using System; namespace ${StandardNamespace} { diff --git a/src/Main/Base/Project/Src/Internal/Templates/File/FileTemplate.cs b/src/Main/Base/Project/Src/Internal/Templates/File/FileTemplate.cs index 89bdfdb5bd..b77a37d9fb 100644 --- a/src/Main/Base/Project/Src/Internal/Templates/File/FileTemplate.cs +++ b/src/Main/Base/Project/Src/Internal/Templates/File/FileTemplate.cs @@ -71,6 +71,7 @@ namespace ICSharpCode.SharpDevelop.Internal.Templates } } + [Obsolete] public class TemplateScript { string languageName; @@ -150,7 +151,6 @@ namespace ICSharpCode.SharpDevelop.Internal.Templates List files = new List(); List properties = new List(); - List scripts = new List(); List customTypes = new List(); XmlElement fileoptions = null; @@ -244,15 +244,17 @@ namespace ICSharpCode.SharpDevelop.Internal.Templates } } + [Obsolete] public List Scripts { get { - return scripts; + return new List(); } } + [Obsolete] public bool HasScripts { get { - return scripts != null && scripts.Count > 0; + return false; } } @@ -314,13 +316,6 @@ namespace ICSharpCode.SharpDevelop.Internal.Templates this.files.Add(new FileDescriptionTemplate((XmlElement)filenode, Path.GetDirectoryName(filename))); } } - - // load scripts (if any) - XmlNodeList scriptList = doc.DocumentElement.SelectNodes("Script"); - foreach (XmlElement scriptElement in scriptList) { - this.scripts.Add(new TemplateScript(scriptElement)); - } - } static FileTemplate() diff --git a/src/Main/Base/Test/CollectionClassOverridesTestFixture.cs b/src/Main/Base/Test/CollectionClassOverridesTestFixture.cs index d9d81df34d..604111d2dd 100644 --- a/src/Main/Base/Test/CollectionClassOverridesTestFixture.cs +++ b/src/Main/Base/Test/CollectionClassOverridesTestFixture.cs @@ -95,6 +95,9 @@ namespace ICSharpCode.SharpDevelop.Tests expectedMethodNames.Add("RemoveItem"); expectedMethodNames.Add("SetItem"); + methodNames.Sort(); + expectedMethodNames.Sort(); + Assert.AreEqual(expectedMethodNames.ToArray(), methodNames.ToArray()); }