From ac2e5587360190ecc82dfe747da1f1f4a41f83bf Mon Sep 17 00:00:00 2001 From: Daniel Grunwald Date: Fri, 22 Jun 2007 20:54:50 +0000 Subject: [PATCH] Fixed broken build. git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@2565 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61 --- .../CreateNewWixProjectObjectTestFixture.cs | 10 ++++--- .../Project/Src/XamlCompilationUnit.cs | 2 +- .../Test/Project/IsTestMethodTests.cs | 9 ------- .../UnitTesting/Test/Utils/MockAttribute.cs | 26 +++++++++---------- .../Test/Utils/MockProjectContent.cs | 5 ++++ 5 files changed, 26 insertions(+), 26 deletions(-) diff --git a/src/AddIns/BackendBindings/WixBinding/Test/Project/CreateNewWixProjectObjectTestFixture.cs b/src/AddIns/BackendBindings/WixBinding/Test/Project/CreateNewWixProjectObjectTestFixture.cs index 310a8b0434..b02bc3f436 100644 --- a/src/AddIns/BackendBindings/WixBinding/Test/Project/CreateNewWixProjectObjectTestFixture.cs +++ b/src/AddIns/BackendBindings/WixBinding/Test/Project/CreateNewWixProjectObjectTestFixture.cs @@ -67,11 +67,15 @@ namespace WixBinding.Tests.Project [Test] public void Imports() { - Assert.AreEqual(2, project.MSBuildProject.Imports.Count); - Microsoft.Build.BuildEngine.Import[] imports = {null, null}; + // this is machine-dependent, it's possible that additional imports are loaded + //Assert.AreEqual(2, project.MSBuildProject.Imports.Count); + Microsoft.Build.BuildEngine.Import[] imports = new Microsoft.Build.BuildEngine.Import[project.MSBuildProject.Imports.Count]; project.MSBuildProject.Imports.CopyTo(imports, 0); - string[] paths = new string[] {imports[0].ProjectPath, imports[1].ProjectPath}; + string[] paths = new string[imports.Length]; + for (int i = 0; i < imports.Length; i++) { + paths[i] = imports[i].ProjectPath; + } Assert.Contains(WixProject.DefaultTargetsFile, paths); Assert.Contains(@"$(MSBuildBinPath)\Microsoft.Common.targets", paths); diff --git a/src/AddIns/BackendBindings/XamlBinding/Project/Src/XamlCompilationUnit.cs b/src/AddIns/BackendBindings/XamlBinding/Project/Src/XamlCompilationUnit.cs index 96e7f1c4ec..a234a9f8ee 100644 --- a/src/AddIns/BackendBindings/XamlBinding/Project/Src/XamlCompilationUnit.cs +++ b/src/AddIns/BackendBindings/XamlBinding/Project/Src/XamlCompilationUnit.cs @@ -49,7 +49,7 @@ namespace XamlBinding if (type != null) return type; foreach (IProjectContent p in this.ProjectContent.ReferencedContents) { - type = FindTypeInAssembly(this.ProjectContent, xmlNamespace, className); + type = FindTypeInAssembly(p, xmlNamespace, className); if (type != null) return type; } diff --git a/src/AddIns/Misc/UnitTesting/Test/Project/IsTestMethodTests.cs b/src/AddIns/Misc/UnitTesting/Test/Project/IsTestMethodTests.cs index f04df14ad9..34c7194748 100644 --- a/src/AddIns/Misc/UnitTesting/Test/Project/IsTestMethodTests.cs +++ b/src/AddIns/Misc/UnitTesting/Test/Project/IsTestMethodTests.cs @@ -55,15 +55,6 @@ namespace UnitTesting.Tests.Project Assert.IsTrue(TestMethod.IsTestMethod(mockMethod)); } - [Test] - public void NullAttributeName() - { - List attributes = new List(); - attributes.Add(new MockAttribute(null)); - MockMethod mockMethod = CreateMockMethod(attributes); - Assert.IsFalse(TestMethod.IsTestMethod(mockMethod)); - } - [Test] public void NullMethod() { diff --git a/src/AddIns/Misc/UnitTesting/Test/Utils/MockAttribute.cs b/src/AddIns/Misc/UnitTesting/Test/Utils/MockAttribute.cs index 8e76c7e525..dbd4049c58 100644 --- a/src/AddIns/Misc/UnitTesting/Test/Utils/MockAttribute.cs +++ b/src/AddIns/Misc/UnitTesting/Test/Utils/MockAttribute.cs @@ -12,15 +12,11 @@ namespace UnitTesting.Tests.Utils { public class MockAttribute : IAttribute { - string name = String.Empty; - - public MockAttribute() - { - } + IReturnType type; public MockAttribute(string name) { - this.name = name; + type = new DefaultReturnType(new MockClass(name)); } public AttributeTarget AttributeTarget { @@ -29,18 +25,22 @@ namespace UnitTesting.Tests.Utils } } - public string Name { + public IReturnType AttributeType { get { - return name; + return type; } - set { - name = value; + } + + public System.Collections.Generic.IList PositionalArguments { + get { + throw new NotImplementedException(); } } - public int CompareTo(object obj) - { - throw new NotImplementedException(); + public System.Collections.Generic.IDictionary NamedArguments { + get { + throw new NotImplementedException(); + } } } } diff --git a/src/AddIns/Misc/UnitTesting/Test/Utils/MockProjectContent.cs b/src/AddIns/Misc/UnitTesting/Test/Utils/MockProjectContent.cs index 281024c54f..0aaae42f83 100644 --- a/src/AddIns/Misc/UnitTesting/Test/Utils/MockProjectContent.cs +++ b/src/AddIns/Misc/UnitTesting/Test/Utils/MockProjectContent.cs @@ -170,5 +170,10 @@ namespace UnitTesting.Tests.Utils throw new NotImplementedException(); } } + + public IList GetAssemblyAttributes() + { + throw new NotImplementedException(); + } } }