Browse Source
git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/branches/2.1@2340 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61shortcuts
19 changed files with 1895 additions and 50 deletions
@ -0,0 +1,63 @@
@@ -0,0 +1,63 @@
|
||||
// <file>
|
||||
// <copyright see="prj:///doc/copyright.txt"/>
|
||||
// <license see="prj:///doc/license.txt"/>
|
||||
// <owner name="Matthew Ward" email="mrward@users.sourceforge.net"/>
|
||||
// <version>$Revision$</version>
|
||||
// </file>
|
||||
|
||||
using System; |
||||
using ICSharpCode.SharpDevelop.Dom; |
||||
using ICSharpCode.SharpDevelop.Tests.Utils; |
||||
using NUnit.Framework; |
||||
|
||||
namespace ICSharpCode.SharpDevelop.Tests |
||||
{ |
||||
/// <summary>
|
||||
/// Tests that the IsOverridable property returns the expected value.
|
||||
/// </summary>
|
||||
[TestFixture] |
||||
public class AbstractDecorationIsOverridableTestFixture |
||||
{ |
||||
MockDecoration decoration; |
||||
|
||||
[SetUp] |
||||
public void SetUp() |
||||
{ |
||||
decoration = new MockDecoration(); |
||||
} |
||||
|
||||
[Test] |
||||
public void NotOverridableByDefault() |
||||
{ |
||||
Assert.IsFalse(decoration.IsOverridable); |
||||
} |
||||
|
||||
[Test] |
||||
public void IsOverrideSet() |
||||
{ |
||||
decoration.Modifiers = ModifierEnum.Override; |
||||
Assert.IsTrue(decoration.IsOverridable); |
||||
} |
||||
|
||||
[Test] |
||||
public void IsVirtualSet() |
||||
{ |
||||
decoration.Modifiers = ModifierEnum.Virtual; |
||||
Assert.IsTrue(decoration.IsOverridable); |
||||
} |
||||
|
||||
[Test] |
||||
public void IsAbstractSet() |
||||
{ |
||||
decoration.Modifiers = ModifierEnum.Abstract; |
||||
Assert.IsTrue(decoration.IsOverridable); |
||||
} |
||||
|
||||
[Test] |
||||
public void IsAbstractAndSealedSet() |
||||
{ |
||||
decoration.Modifiers = ModifierEnum.Abstract | ModifierEnum.Sealed; |
||||
Assert.IsFalse(decoration.IsOverridable); |
||||
} |
||||
} |
||||
} |
||||
@ -0,0 +1,142 @@
@@ -0,0 +1,142 @@
|
||||
// <file>
|
||||
// <copyright see="prj:///doc/copyright.txt"/>
|
||||
// <license see="prj:///doc/license.txt"/>
|
||||
// <owner name="Matthew Ward" email="mrward@users.sourceforge.net"/>
|
||||
// <version>$Revision$</version>
|
||||
// </file>
|
||||
|
||||
using System; |
||||
using System.Collections.Generic; |
||||
using System.Collections.ObjectModel; |
||||
using System.Reflection; |
||||
using System.Text; |
||||
|
||||
using ICSharpCode.Core; |
||||
using ICSharpCode.SharpDevelop.DefaultEditor.Commands; |
||||
using ICSharpCode.SharpDevelop.Dom; |
||||
using ICSharpCode.SharpDevelop.Dom.CSharp; |
||||
using ICSharpCode.SharpDevelop.Project; |
||||
using ICSharpCode.SharpDevelop.Tests.Utils; |
||||
using NUnit.Framework; |
||||
|
||||
namespace ICSharpCode.SharpDevelop.Tests |
||||
{ |
||||
/// <summary>
|
||||
/// SD2-1199. Tests the available overrides for the
|
||||
/// System.Collections.ObjectModel.Collection class.
|
||||
/// </summary>
|
||||
[TestFixture] |
||||
public class CollectionClassOverridesTestFixture |
||||
{ |
||||
[TestFixtureSetUp] |
||||
public void SetUpFixture() |
||||
{ |
||||
if (!PropertyService.Initialized) { |
||||
PropertyService.InitializeService(String.Empty, String.Empty, String.Empty); |
||||
} |
||||
} |
||||
|
||||
/// <summary>
|
||||
/// This shows how to get the list of overridable methods in the
|
||||
/// Collection class using reflection only.
|
||||
/// </summary>
|
||||
public void GetMethodsThroughReflection() |
||||
{ |
||||
Assembly a = Assembly.Load("mscorlib"); |
||||
Type t = a.GetType("System.Collections.ObjectModel.Collection`1"); |
||||
|
||||
List<string> methodNames = new List<string>(); |
||||
BindingFlags bindingFlags = BindingFlags.Instance | |
||||
BindingFlags.NonPublic | |
||||
BindingFlags.DeclaredOnly | |
||||
BindingFlags.Public; |
||||
|
||||
foreach (MethodInfo m in t.GetMethods(bindingFlags)) { |
||||
if (m.IsVirtual && !m.IsSpecialName && !m.IsFinal) { |
||||
methodNames.Add(m.Name); |
||||
} |
||||
} |
||||
|
||||
List<string> expectedMethodNames = new List<string>(); |
||||
expectedMethodNames.Add("ClearItems"); |
||||
expectedMethodNames.Add("InsertItem"); |
||||
expectedMethodNames.Add("RemoveItem"); |
||||
expectedMethodNames.Add("SetItem"); |
||||
|
||||
StringBuilder sb = new StringBuilder(); |
||||
foreach (string s in methodNames.ToArray()) { |
||||
sb.AppendLine(s); |
||||
} |
||||
Assert.AreEqual(expectedMethodNames.ToArray(), methodNames.ToArray(), sb.ToString()); |
||||
} |
||||
|
||||
/// <summary>
|
||||
/// Tests that the IsSealed property is set for methods that are
|
||||
/// flagged as final. The ReflectionMethod class was not setting
|
||||
/// this correctly.
|
||||
/// </summary>
|
||||
[Test] |
||||
public void ExpectedMethodsFromProjectContent() |
||||
{ |
||||
ProjectContentRegistry registry = new ProjectContentRegistry(); |
||||
IProjectContent mscorlibProjectContent = registry.Mscorlib; |
||||
IClass c = mscorlibProjectContent.GetClass("System.Collections.ObjectModel.Collection"); |
||||
|
||||
List<string> methodNames = new List<string>(); |
||||
foreach (IMethod m in c.Methods) { |
||||
if (m.IsVirtual && !m.IsSealed) { |
||||
methodNames.Add(m.Name); |
||||
} |
||||
} |
||||
|
||||
List<string> expectedMethodNames = new List<string>(); |
||||
expectedMethodNames.Add("ClearItems"); |
||||
expectedMethodNames.Add("InsertItem"); |
||||
expectedMethodNames.Add("RemoveItem"); |
||||
expectedMethodNames.Add("SetItem"); |
||||
|
||||
Assert.AreEqual(expectedMethodNames.ToArray(), methodNames.ToArray()); |
||||
} |
||||
|
||||
/// <summary>
|
||||
/// Tests that the OverrideMethodsCodeGenerator returns the correct
|
||||
/// methods for the System.Collections.ObjectModel.Collection type.
|
||||
/// </summary>
|
||||
[Test] |
||||
public void CodeGeneratorMethods() |
||||
{ |
||||
ProjectContentRegistry registry = new ProjectContentRegistry(); |
||||
IProjectContent mscorlibProjectContent = registry.Mscorlib; |
||||
IClass collectionClass = mscorlibProjectContent.GetClass("System.Collections.ObjectModel.Collection"); |
||||
|
||||
DefaultProjectContent projectContent = new DefaultProjectContent(); |
||||
DefaultCompilationUnit unit = new DefaultCompilationUnit(projectContent); |
||||
DefaultClass c = new DefaultClass(unit, "MyCollection"); |
||||
c.BaseTypes.Add(new DefaultReturnType(collectionClass)); |
||||
|
||||
MockProject project = new MockProject(); |
||||
ProjectService.CurrentProject = project; |
||||
|
||||
OverrideMethodsCodeGenerator codeGenerator = new OverrideMethodsCodeGenerator(); |
||||
codeGenerator.Initialize(c); |
||||
|
||||
List<string> methods = new List<string>(); |
||||
foreach (object o in codeGenerator.Content) { |
||||
methods.Add(o.ToString()); |
||||
} |
||||
|
||||
List<string> expectedMethods = new List<string>(); |
||||
expectedMethods.Add("ClearItems"); |
||||
expectedMethods.Add("Equals"); |
||||
expectedMethods.Add("Finalize"); |
||||
expectedMethods.Add("GetHashCode"); |
||||
expectedMethods.Add("InsertItem"); |
||||
expectedMethods.Add("RemoveItem"); |
||||
expectedMethods.Add("SetItem"); |
||||
expectedMethods.Add("ToString"); |
||||
|
||||
Assert.AreEqual(expectedMethods.ToArray(), methods.ToArray()); |
||||
} |
||||
} |
||||
} |
||||
|
||||
@ -0,0 +1,143 @@
@@ -0,0 +1,143 @@
|
||||
// <file>
|
||||
// <copyright see="prj:///doc/copyright.txt"/>
|
||||
// <license see="prj:///doc/license.txt"/>
|
||||
// <owner name="Matthew Ward" email="mrward@users.sourceforge.net"/>
|
||||
// <version>$Revision$</version>
|
||||
// </file>
|
||||
|
||||
using System; |
||||
using System.Collections.Generic; |
||||
using System.Collections.ObjectModel; |
||||
using System.Reflection; |
||||
using System.Text; |
||||
|
||||
using ICSharpCode.Core; |
||||
using ICSharpCode.SharpDevelop.DefaultEditor.Commands; |
||||
using ICSharpCode.SharpDevelop.Dom; |
||||
using ICSharpCode.SharpDevelop.Dom.CSharp; |
||||
using ICSharpCode.SharpDevelop.Project; |
||||
using ICSharpCode.SharpDevelop.Tests.Utils; |
||||
using NUnit.Framework; |
||||
|
||||
namespace ICSharpCode.SharpDevelop.Tests |
||||
{ |
||||
/// <summary>
|
||||
/// Tests the available overrides for the
|
||||
/// System.Exception class.
|
||||
/// </summary>
|
||||
[TestFixture] |
||||
public class ExceptionClassOverridesTestFixture |
||||
{ |
||||
[TestFixtureSetUp] |
||||
public void SetUpFixture() |
||||
{ |
||||
if (!PropertyService.Initialized) { |
||||
PropertyService.InitializeService(String.Empty, String.Empty, String.Empty); |
||||
} |
||||
} |
||||
|
||||
/// <summary>
|
||||
/// This shows how to get the list of overridable properties in the
|
||||
/// Exception class using reflection only.
|
||||
/// </summary>
|
||||
public void GetPropertiesThroughReflection() |
||||
{ |
||||
Assembly a = Assembly.Load("mscorlib"); |
||||
Type t = a.GetType("System.Exception"); |
||||
|
||||
List<string> propertyNames = new List<string>(); |
||||
BindingFlags bindingFlags = BindingFlags.Instance | |
||||
BindingFlags.NonPublic | |
||||
BindingFlags.DeclaredOnly | |
||||
BindingFlags.Public; |
||||
|
||||
foreach (PropertyInfo p in t.GetProperties(bindingFlags)) { |
||||
MethodInfo m = p.GetGetMethod(true); |
||||
if (m.IsVirtual && !m.IsPrivate && !m.IsFinal) { |
||||
propertyNames.Add(p.Name); |
||||
} |
||||
} |
||||
|
||||
List<string> expectedPropertyNames = new List<string>(); |
||||
expectedPropertyNames.Add("Data"); |
||||
expectedPropertyNames.Add("HelpLink"); |
||||
expectedPropertyNames.Add("Message"); |
||||
expectedPropertyNames.Add("Source"); |
||||
expectedPropertyNames.Add("StackTrace"); |
||||
|
||||
StringBuilder sb = new StringBuilder(); |
||||
foreach (string s in propertyNames.ToArray()) { |
||||
sb.AppendLine(s); |
||||
} |
||||
Assert.AreEqual(expectedPropertyNames.ToArray(), propertyNames.ToArray(), sb.ToString()); |
||||
} |
||||
|
||||
/// <summary>
|
||||
/// Tests that the IsSealed property is set for properties that are
|
||||
/// flagged as final. The ReflectionProperty class was not setting
|
||||
/// this correctly.
|
||||
/// </summary>
|
||||
[Test] |
||||
public void ExpectedPropertiesFromProjectContent() |
||||
{ |
||||
ProjectContentRegistry registry = new ProjectContentRegistry(); |
||||
IProjectContent mscorlibProjectContent = registry.Mscorlib; |
||||
IClass c = mscorlibProjectContent.GetClass("System.Exception"); |
||||
|
||||
List<string> propertyNames = new List<string>(); |
||||
foreach (IProperty p in c.Properties) { |
||||
if (p.IsVirtual && !p.IsSealed) { |
||||
propertyNames.Add(p.Name); |
||||
} |
||||
} |
||||
propertyNames.Sort(); |
||||
|
||||
List<string> expectedPropertyNames = new List<string>(); |
||||
expectedPropertyNames.Add("Data"); |
||||
expectedPropertyNames.Add("HelpLink"); |
||||
expectedPropertyNames.Add("Message"); |
||||
expectedPropertyNames.Add("Source"); |
||||
expectedPropertyNames.Add("StackTrace"); |
||||
|
||||
Assert.AreEqual(expectedPropertyNames.ToArray(), propertyNames.ToArray()); |
||||
} |
||||
|
||||
/// <summary>
|
||||
/// Tests that the OverridePropertyCodeGenerator returns the correct
|
||||
/// methods for the System.Exception type.
|
||||
/// </summary>
|
||||
[Test] |
||||
public void CodeGeneratorProperties() |
||||
{ |
||||
ProjectContentRegistry registry = new ProjectContentRegistry(); |
||||
IProjectContent mscorlibProjectContent = registry.Mscorlib; |
||||
IClass exceptionClass = mscorlibProjectContent.GetClass("System.Exception"); |
||||
|
||||
DefaultProjectContent projectContent = new DefaultProjectContent(); |
||||
DefaultCompilationUnit unit = new DefaultCompilationUnit(projectContent); |
||||
DefaultClass c = new DefaultClass(unit, "MyException"); |
||||
c.BaseTypes.Add(new DefaultReturnType(exceptionClass)); |
||||
|
||||
MockProject project = new MockProject(); |
||||
ProjectService.CurrentProject = project; |
||||
|
||||
OverridePropertiesCodeGenerator codeGenerator = new OverridePropertiesCodeGenerator(); |
||||
codeGenerator.Initialize(c); |
||||
|
||||
List<string> properties = new List<string>(); |
||||
foreach (object o in codeGenerator.Content) { |
||||
properties.Add(o.ToString()); |
||||
} |
||||
|
||||
List<string> expectedProperties = new List<string>(); |
||||
expectedProperties.Add("Data"); |
||||
expectedProperties.Add("HelpLink"); |
||||
expectedProperties.Add("Message"); |
||||
expectedProperties.Add("Source"); |
||||
expectedProperties.Add("StackTrace"); |
||||
|
||||
Assert.AreEqual(expectedProperties.ToArray(), properties.ToArray()); |
||||
} |
||||
} |
||||
} |
||||
|
||||
@ -0,0 +1,134 @@
@@ -0,0 +1,134 @@
|
||||
// <file>
|
||||
// <copyright see="prj:///doc/copyright.txt"/>
|
||||
// <license see="prj:///doc/license.txt"/>
|
||||
// <owner name="Matthew Ward" email="mrward@users.sourceforge.net"/>
|
||||
// <version>$Revision$</version>
|
||||
// </file>
|
||||
|
||||
using System; |
||||
using System.Collections.Generic; |
||||
using ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor; |
||||
using ICSharpCode.SharpDevelop.Dom; |
||||
using ICSharpCode.SharpDevelop.Tests.Utils; |
||||
using NUnit.Framework; |
||||
|
||||
namespace ICSharpCode.SharpDevelop.Tests |
||||
{ |
||||
/// <summary>
|
||||
/// Tests the OverrideCompletionDataProvider GetOverridableMethods.
|
||||
/// This method should be added to the IClass interface.
|
||||
/// </summary>
|
||||
[TestFixture] |
||||
public class OverridableMethodsTestFixture |
||||
{ |
||||
MockClass c; |
||||
MockDefaultReturnType returnType; |
||||
List<IMethod> expectedMethods; |
||||
MockClass declaringType; |
||||
|
||||
[SetUp] |
||||
public void SetUp() |
||||
{ |
||||
expectedMethods = new List<IMethod>(); |
||||
c = new MockClass("MyClass"); |
||||
declaringType = new MockClass("MyDeclaringType"); |
||||
returnType = new MockDefaultReturnType(); |
||||
c.DefaultReturnType = returnType; |
||||
} |
||||
|
||||
/// <summary>
|
||||
/// Add one overridable method to the return type and this
|
||||
/// should be returned in the list of overridable methods.
|
||||
/// </summary>
|
||||
[Test] |
||||
public void OneOverridableMethodReturned() |
||||
{ |
||||
MockMethod method = new MockMethod("Run"); |
||||
method.DeclaringType = declaringType; |
||||
method.IsOverridable = true; |
||||
returnType.Methods.Add(method); |
||||
|
||||
expectedMethods.Add(method); |
||||
|
||||
IMethod[] methods = OverrideCompletionDataProvider.GetOverridableMethods(c); |
||||
|
||||
AssertAreMethodsEqual(expectedMethods, methods); |
||||
} |
||||
|
||||
/// <summary>
|
||||
/// Make sure that an overridable method is not returned when
|
||||
/// it is part of the class being considered.
|
||||
/// </summary>
|
||||
[Test] |
||||
public void OverridableMethodPartOfClass() |
||||
{ |
||||
MockMethod method = new MockMethod("Run"); |
||||
method.DeclaringType = c; |
||||
method.IsOverridable = true; |
||||
returnType.Methods.Add(method); |
||||
|
||||
IMethod[] methods = OverrideCompletionDataProvider.GetOverridableMethods(c); |
||||
|
||||
AssertAreMethodsEqual(expectedMethods, methods); |
||||
} |
||||
|
||||
/// <summary>
|
||||
/// An overridable but const method should not be returned.
|
||||
/// </summary>
|
||||
[Test] |
||||
public void OverridableConstMethodNotReturned() |
||||
{ |
||||
MockMethod method = new MockMethod("Run"); |
||||
method.DeclaringType = declaringType; |
||||
method.IsOverridable = true; |
||||
method.IsConst = true; |
||||
returnType.Methods.Add(method); |
||||
|
||||
IMethod[] methods = OverrideCompletionDataProvider.GetOverridableMethods(c); |
||||
|
||||
AssertAreMethodsEqual(expectedMethods, methods); |
||||
} |
||||
|
||||
/// <summary>
|
||||
/// An overridable but private method should not be returned.
|
||||
/// </summary>
|
||||
[Test] |
||||
public void OverridablePrivateMethodNotReturned() |
||||
{ |
||||
MockMethod method = new MockMethod("Run"); |
||||
method.DeclaringType = declaringType; |
||||
method.IsOverridable = true; |
||||
method.IsPrivate = true; |
||||
returnType.Methods.Add(method); |
||||
|
||||
IMethod[] methods = OverrideCompletionDataProvider.GetOverridableMethods(c); |
||||
|
||||
AssertAreMethodsEqual(expectedMethods, methods); |
||||
} |
||||
|
||||
[Test] |
||||
[ExpectedException(typeof(ArgumentException))] |
||||
public void NullArgument() |
||||
{ |
||||
OverrideCompletionDataProvider.GetOverridableMethods(null); |
||||
} |
||||
|
||||
void AssertAreMethodsEqual(List<IMethod> expectedMethods, IMethod[] methods) |
||||
{ |
||||
// Get a list of expected method names.
|
||||
List<string> expectedMethodNames = new List<string>(); |
||||
foreach (IMethod expectedMethod in expectedMethods) { |
||||
expectedMethodNames.Add(expectedMethod.Name); |
||||
} |
||||
|
||||
// Get a list of actual method names.
|
||||
List<string> methodNames = new List<string>(); |
||||
foreach (IMethod m in methods) { |
||||
methodNames.Add(m.Name); |
||||
} |
||||
|
||||
// Compare the two arrays.
|
||||
Assert.AreEqual(expectedMethodNames.ToArray(), methodNames.ToArray()); |
||||
} |
||||
} |
||||
} |
||||
@ -0,0 +1,134 @@
@@ -0,0 +1,134 @@
|
||||
// <file>
|
||||
// <copyright see="prj:///doc/copyright.txt"/>
|
||||
// <license see="prj:///doc/license.txt"/>
|
||||
// <owner name="Matthew Ward" email="mrward@users.sourceforge.net"/>
|
||||
// <version>$Revision$</version>
|
||||
// </file>
|
||||
|
||||
using System; |
||||
using System.Collections.Generic; |
||||
using ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor; |
||||
using ICSharpCode.SharpDevelop.Dom; |
||||
using ICSharpCode.SharpDevelop.Tests.Utils; |
||||
using NUnit.Framework; |
||||
|
||||
namespace ICSharpCode.SharpDevelop.Tests |
||||
{ |
||||
/// <summary>
|
||||
/// Tests the OverrideCompletionDataProvider GetOverridableProperties.
|
||||
/// This property should be added to the IClass interface.
|
||||
/// </summary>
|
||||
[TestFixture] |
||||
public class OverridablePropertiesTestFixture |
||||
{ |
||||
MockClass c; |
||||
MockDefaultReturnType returnType; |
||||
List<IProperty> expectedProperties; |
||||
MockClass declaringType; |
||||
|
||||
[SetUp] |
||||
public void SetUp() |
||||
{ |
||||
expectedProperties = new List<IProperty>(); |
||||
c = new MockClass("MyClass"); |
||||
declaringType = new MockClass("MyDeclaringType"); |
||||
returnType = new MockDefaultReturnType(); |
||||
c.DefaultReturnType = returnType; |
||||
} |
||||
|
||||
/// <summary>
|
||||
/// Add one overridable property to the return type and this
|
||||
/// should be returned in the list of overridable properties.
|
||||
/// </summary>
|
||||
[Test] |
||||
public void OneOverridablePropertyReturned() |
||||
{ |
||||
MockProperty property = new MockProperty("IsRunning"); |
||||
property.DeclaringType = declaringType; |
||||
property.IsOverridable = true; |
||||
returnType.Properties.Add(property); |
||||
|
||||
expectedProperties.Add(property); |
||||
|
||||
IProperty[] properties = OverrideCompletionDataProvider.GetOverridableProperties(c); |
||||
|
||||
AssertArePropertiesEqual(expectedProperties, properties); |
||||
} |
||||
|
||||
/// <summary>
|
||||
/// Make sure that an overridable property is not returned when
|
||||
/// it is part of the class being considered.
|
||||
/// </summary>
|
||||
[Test] |
||||
public void OverridablePropertyPartOfClass() |
||||
{ |
||||
MockProperty property = new MockProperty("IsRunning"); |
||||
property.DeclaringType = c; |
||||
property.IsOverridable = true; |
||||
returnType.Properties.Add(property); |
||||
|
||||
IProperty[] properties = OverrideCompletionDataProvider.GetOverridableProperties(c); |
||||
|
||||
AssertArePropertiesEqual(expectedProperties, properties); |
||||
} |
||||
|
||||
/// <summary>
|
||||
/// An overridable but const property should not be returned.
|
||||
/// </summary>
|
||||
[Test] |
||||
public void OverridableConstPropertyNotReturned() |
||||
{ |
||||
MockProperty property = new MockProperty("IsRunning"); |
||||
property.DeclaringType = declaringType; |
||||
property.IsOverridable = true; |
||||
property.IsConst = true; |
||||
returnType.Properties.Add(property); |
||||
|
||||
IProperty[] properties = OverrideCompletionDataProvider.GetOverridableProperties(c); |
||||
|
||||
AssertArePropertiesEqual(expectedProperties, properties); |
||||
} |
||||
|
||||
/// <summary>
|
||||
/// An overridable but private property should not be returned.
|
||||
/// </summary>
|
||||
[Test] |
||||
public void OverridablePrivatePropertyNotReturned() |
||||
{ |
||||
MockProperty property = new MockProperty("Run"); |
||||
property.DeclaringType = declaringType; |
||||
property.IsOverridable = true; |
||||
property.IsPrivate = true; |
||||
returnType.Properties.Add(property); |
||||
|
||||
IProperty[] properties = OverrideCompletionDataProvider.GetOverridableProperties(c); |
||||
|
||||
AssertArePropertiesEqual(expectedProperties, properties); |
||||
} |
||||
|
||||
[Test] |
||||
[ExpectedException(typeof(ArgumentException))] |
||||
public void NullArgument() |
||||
{ |
||||
OverrideCompletionDataProvider.GetOverridableProperties(null); |
||||
} |
||||
|
||||
void AssertArePropertiesEqual(List<IProperty> expectedProperties, IProperty[] properties) |
||||
{ |
||||
// Get a list of expected property names.
|
||||
List<string> expectedPropertyNames = new List<string>(); |
||||
foreach (IProperty expectedProperty in expectedProperties) { |
||||
expectedPropertyNames.Add(expectedProperty.Name); |
||||
} |
||||
|
||||
// Get a list of actual property names.
|
||||
List<string> propertyNames = new List<string>(); |
||||
foreach (IProperty p in properties) { |
||||
propertyNames.Add(p.Name); |
||||
} |
||||
|
||||
// Compare the two arrays.
|
||||
Assert.AreEqual(expectedPropertyNames.ToArray(), propertyNames.ToArray()); |
||||
} |
||||
} |
||||
} |
||||
@ -0,0 +1,87 @@
@@ -0,0 +1,87 @@
|
||||
// <file>
|
||||
// <copyright see="prj:///doc/copyright.txt"/>
|
||||
// <license see="prj:///doc/license.txt"/>
|
||||
// <owner name="Matthew Ward" email="mrward@users.sourceforge.net"/>
|
||||
// <version>$Revision$</version>
|
||||
// </file>
|
||||
|
||||
using System; |
||||
using ICSharpCode.SharpDevelop.Dom; |
||||
|
||||
namespace ICSharpCode.SharpDevelop.Tests.Utils |
||||
{ |
||||
/// <summary>
|
||||
/// Mock Ambience class.
|
||||
/// </summary>
|
||||
public class MockAmbience : AbstractAmbience |
||||
{ |
||||
public MockAmbience() |
||||
{ |
||||
} |
||||
|
||||
public override string Convert(ModifierEnum modifier) |
||||
{ |
||||
return String.Empty; |
||||
} |
||||
|
||||
public override string Convert(IClass c) |
||||
{ |
||||
return String.Empty; |
||||
} |
||||
|
||||
public override string ConvertEnd(IClass c) |
||||
{ |
||||
return String.Empty; |
||||
} |
||||
|
||||
public override string Convert(IField c) |
||||
{ |
||||
return String.Empty; |
||||
} |
||||
|
||||
public override string Convert(IProperty property) |
||||
{ |
||||
return property.Name; |
||||
} |
||||
|
||||
public override string Convert(IEvent e) |
||||
{ |
||||
return String.Empty; |
||||
} |
||||
|
||||
public override string Convert(IMethod m) |
||||
{ |
||||
return m.Name; |
||||
} |
||||
|
||||
public override string ConvertEnd(IMethod m) |
||||
{ |
||||
return String.Empty; |
||||
} |
||||
|
||||
public override string Convert(IParameter param) |
||||
{ |
||||
return String.Empty; |
||||
} |
||||
|
||||
public override string Convert(IReturnType returnType) |
||||
{ |
||||
return String.Empty; |
||||
} |
||||
|
||||
public override string WrapAttribute(string attribute) |
||||
{ |
||||
return String.Empty; |
||||
} |
||||
|
||||
public override string WrapComment(string comment) |
||||
{ |
||||
return String.Empty; |
||||
} |
||||
|
||||
public override string GetIntrinsicTypeName(string dotNetTypeName) |
||||
{ |
||||
return String.Empty; |
||||
} |
||||
} |
||||
} |
||||
@ -0,0 +1,354 @@
@@ -0,0 +1,354 @@
|
||||
// <file>
|
||||
// <copyright see="prj:///doc/copyright.txt"/>
|
||||
// <license see="prj:///doc/license.txt"/>
|
||||
// <owner name="Matthew Ward" email="mrward@users.sourceforge.net"/>
|
||||
// <version>$Revision$</version>
|
||||
// </file>
|
||||
|
||||
using ICSharpCode.SharpDevelop.Dom; |
||||
using System; |
||||
using System.Collections.Generic; |
||||
|
||||
namespace ICSharpCode.SharpDevelop.Tests.Utils |
||||
{ |
||||
/// <summary>
|
||||
/// Dummy class that implements the IClass interface. The
|
||||
/// only property this mock class implements is the DefaultReturnType
|
||||
/// property.
|
||||
/// </summary>
|
||||
public class MockClass : IClass |
||||
{ |
||||
IReturnType returnType; |
||||
string qualifiedName = String.Empty; |
||||
|
||||
public MockClass(string qualifiedName) |
||||
{ |
||||
this.qualifiedName = qualifiedName; |
||||
} |
||||
|
||||
public string FullyQualifiedName { |
||||
get { |
||||
return qualifiedName; |
||||
} |
||||
set { |
||||
qualifiedName = value; |
||||
} |
||||
} |
||||
|
||||
public IReturnType DefaultReturnType { |
||||
get { |
||||
return returnType; |
||||
} |
||||
set { |
||||
returnType = value; |
||||
} |
||||
} |
||||
|
||||
public string DotNetName { |
||||
get { |
||||
throw new NotImplementedException(); |
||||
} |
||||
} |
||||
|
||||
public string Name { |
||||
get { |
||||
throw new NotImplementedException(); |
||||
} |
||||
} |
||||
|
||||
public string Namespace { |
||||
get { |
||||
throw new NotImplementedException(); |
||||
} |
||||
} |
||||
|
||||
public ClassType ClassType { |
||||
get { |
||||
throw new NotImplementedException(); |
||||
} |
||||
} |
||||
|
||||
public IProjectContent ProjectContent { |
||||
get { |
||||
throw new NotImplementedException(); |
||||
} |
||||
} |
||||
|
||||
public ICompilationUnit CompilationUnit { |
||||
get { |
||||
throw new NotImplementedException(); |
||||
} |
||||
} |
||||
|
||||
public DomRegion Region { |
||||
get { |
||||
throw new NotImplementedException(); |
||||
} |
||||
} |
||||
|
||||
public DomRegion BodyRegion { |
||||
get { |
||||
throw new NotImplementedException(); |
||||
} |
||||
} |
||||
|
||||
public List<IReturnType> BaseTypes { |
||||
get { |
||||
throw new NotImplementedException(); |
||||
} |
||||
} |
||||
|
||||
public List<IClass> InnerClasses { |
||||
get { |
||||
throw new NotImplementedException(); |
||||
} |
||||
} |
||||
|
||||
public List<IField> Fields { |
||||
get { |
||||
throw new NotImplementedException(); |
||||
} |
||||
} |
||||
|
||||
public List<IProperty> Properties { |
||||
get { |
||||
throw new NotImplementedException(); |
||||
} |
||||
} |
||||
|
||||
public List<IMethod> Methods { |
||||
get { |
||||
throw new NotImplementedException(); |
||||
} |
||||
} |
||||
|
||||
public List<IEvent> Events { |
||||
get { |
||||
throw new NotImplementedException(); |
||||
} |
||||
} |
||||
|
||||
public IList<ITypeParameter> TypeParameters { |
||||
get { |
||||
throw new NotImplementedException(); |
||||
} |
||||
} |
||||
|
||||
public IEnumerable<IClass> ClassInheritanceTree { |
||||
get { |
||||
throw new NotImplementedException(); |
||||
} |
||||
} |
||||
|
||||
public IClass BaseClass { |
||||
get { |
||||
throw new NotImplementedException(); |
||||
} |
||||
} |
||||
|
||||
public IReturnType BaseType { |
||||
get { |
||||
throw new NotImplementedException(); |
||||
} |
||||
} |
||||
|
||||
public bool HasPublicOrInternalStaticMembers { |
||||
get { |
||||
throw new NotImplementedException(); |
||||
} |
||||
} |
||||
|
||||
public bool HasExtensionMethods { |
||||
get { |
||||
throw new NotImplementedException(); |
||||
} |
||||
} |
||||
|
||||
public bool IsPartial { |
||||
get { |
||||
throw new NotImplementedException(); |
||||
} |
||||
set { |
||||
throw new NotImplementedException(); |
||||
} |
||||
} |
||||
|
||||
public IClass DeclaringType { |
||||
get { |
||||
throw new NotImplementedException(); |
||||
} |
||||
} |
||||
|
||||
public ModifierEnum Modifiers { |
||||
get { |
||||
throw new NotImplementedException(); |
||||
} |
||||
set { |
||||
throw new NotImplementedException(); |
||||
} |
||||
} |
||||
|
||||
public IList<IAttribute> Attributes { |
||||
get { |
||||
throw new NotImplementedException(); |
||||
} |
||||
} |
||||
|
||||
public string Documentation { |
||||
get { |
||||
throw new NotImplementedException(); |
||||
} |
||||
} |
||||
|
||||
public bool IsAbstract { |
||||
get { |
||||
throw new NotImplementedException(); |
||||
} |
||||
} |
||||
|
||||
public bool IsSealed { |
||||
get { |
||||
throw new NotImplementedException(); |
||||
} |
||||
} |
||||
|
||||
public bool IsStatic { |
||||
get { |
||||
throw new NotImplementedException(); |
||||
} |
||||
} |
||||
|
||||
public bool IsConst { |
||||
get { |
||||
throw new NotImplementedException(); |
||||
} |
||||
} |
||||
|
||||
public bool IsVirtual { |
||||
get { |
||||
throw new NotImplementedException(); |
||||
} |
||||
} |
||||
|
||||
public bool IsPublic { |
||||
get { |
||||
throw new NotImplementedException(); |
||||
} |
||||
} |
||||
|
||||
public bool IsProtected { |
||||
get { |
||||
throw new NotImplementedException(); |
||||
} |
||||
} |
||||
|
||||
public bool IsPrivate { |
||||
get { |
||||
throw new NotImplementedException(); |
||||
} |
||||
} |
||||
|
||||
public bool IsInternal { |
||||
get { |
||||
throw new NotImplementedException(); |
||||
} |
||||
} |
||||
|
||||
public bool IsReadonly { |
||||
get { |
||||
throw new NotImplementedException(); |
||||
} |
||||
} |
||||
|
||||
public bool IsProtectedAndInternal { |
||||
get { |
||||
throw new NotImplementedException(); |
||||
} |
||||
} |
||||
|
||||
public bool IsProtectedOrInternal { |
||||
get { |
||||
throw new NotImplementedException(); |
||||
} |
||||
} |
||||
|
||||
public bool IsOverride { |
||||
get { |
||||
throw new NotImplementedException(); |
||||
} |
||||
} |
||||
|
||||
public bool IsOverridable { |
||||
get { |
||||
throw new NotImplementedException(); |
||||
} |
||||
} |
||||
|
||||
public bool IsNew { |
||||
get { |
||||
throw new NotImplementedException(); |
||||
} |
||||
} |
||||
|
||||
public bool IsSynthetic { |
||||
get { |
||||
throw new NotImplementedException(); |
||||
} |
||||
} |
||||
|
||||
public object UserData { |
||||
get { |
||||
throw new NotImplementedException(); |
||||
} |
||||
set { |
||||
throw new NotImplementedException(); |
||||
} |
||||
} |
||||
|
||||
public IReturnType GetBaseType(int index) |
||||
{ |
||||
throw new NotImplementedException(); |
||||
} |
||||
|
||||
public IClass GetCompoundClass() |
||||
{ |
||||
throw new NotImplementedException(); |
||||
} |
||||
|
||||
public IClass GetInnermostClass(int caretLine, int caretColumn) |
||||
{ |
||||
throw new NotImplementedException(); |
||||
} |
||||
|
||||
public List<IClass> GetAccessibleTypes(IClass callingClass) |
||||
{ |
||||
throw new NotImplementedException(); |
||||
} |
||||
|
||||
public IMember SearchMember(string memberName, LanguageProperties language) |
||||
{ |
||||
throw new NotImplementedException(); |
||||
} |
||||
|
||||
public bool IsTypeInInheritanceTree(IClass possibleBaseClass) |
||||
{ |
||||
throw new NotImplementedException(); |
||||
} |
||||
|
||||
public bool IsAccessible(IClass callingClass, bool isClassInInheritanceTree) |
||||
{ |
||||
throw new NotImplementedException(); |
||||
} |
||||
|
||||
public bool MustBeShown(IClass callingClass, bool showStatic, bool isClassInInheritanceTree) |
||||
{ |
||||
throw new NotImplementedException(); |
||||
} |
||||
|
||||
public int CompareTo(object obj) |
||||
{ |
||||
throw new NotImplementedException(); |
||||
} |
||||
|
||||
} |
||||
} |
||||
@ -0,0 +1,25 @@
@@ -0,0 +1,25 @@
|
||||
// <file>
|
||||
// <copyright see="prj:///doc/copyright.txt"/>
|
||||
// <license see="prj:///doc/license.txt"/>
|
||||
// <owner name="Matthew Ward" email="mrward@users.sourceforge.net"/>
|
||||
// <version>$Revision$</version>
|
||||
// </file>
|
||||
|
||||
using System; |
||||
using ICSharpCode.SharpDevelop.Dom; |
||||
|
||||
namespace ICSharpCode.SharpDevelop.Tests.Utils |
||||
{ |
||||
public class MockDecoration : AbstractDecoration |
||||
{ |
||||
public MockDecoration() : base(null) |
||||
{ |
||||
} |
||||
|
||||
public override string DocumentationTag { |
||||
get { |
||||
return String.Empty; |
||||
} |
||||
} |
||||
} |
||||
} |
||||
@ -0,0 +1,137 @@
@@ -0,0 +1,137 @@
|
||||
// <file>
|
||||
// <copyright see="prj:///doc/copyright.txt"/>
|
||||
// <license see="prj:///doc/license.txt"/>
|
||||
// <owner name="Matthew Ward" email="mrward@users.sourceforge.net"/>
|
||||
// <version>$Revision$</version>
|
||||
// </file>
|
||||
|
||||
using ICSharpCode.SharpDevelop.Dom; |
||||
using System; |
||||
using System.Collections.Generic; |
||||
|
||||
namespace ICSharpCode.SharpDevelop.Tests.Utils |
||||
{ |
||||
public class MockDefaultReturnType : IReturnType |
||||
{ |
||||
List<IMethod> methods = new List<IMethod>(); |
||||
List<IProperty> properties = new List<IProperty>(); |
||||
|
||||
public MockDefaultReturnType() |
||||
{ |
||||
} |
||||
|
||||
/// <summary>
|
||||
/// Gets the method list directly. Only available in the
|
||||
/// mock default return type class.
|
||||
/// </summary>
|
||||
public List<IMethod> Methods { |
||||
get { |
||||
return methods; |
||||
} |
||||
} |
||||
|
||||
/// <summary>
|
||||
/// Gets the property list directly. Only available in the
|
||||
/// mock default return type class.
|
||||
/// </summary>
|
||||
public List<IProperty> Properties { |
||||
get { |
||||
return properties; |
||||
} |
||||
} |
||||
|
||||
public string FullyQualifiedName { |
||||
get { |
||||
throw new NotImplementedException(); |
||||
} |
||||
} |
||||
|
||||
public string Name { |
||||
get { |
||||
throw new NotImplementedException(); |
||||
} |
||||
} |
||||
|
||||
public string Namespace { |
||||
get { |
||||
throw new NotImplementedException(); |
||||
} |
||||
} |
||||
|
||||
public string DotNetName { |
||||
get { |
||||
throw new NotImplementedException(); |
||||
} |
||||
} |
||||
|
||||
public int TypeParameterCount { |
||||
get { |
||||
throw new NotImplementedException(); |
||||
} |
||||
} |
||||
|
||||
public bool IsDefaultReturnType { |
||||
get { |
||||
throw new NotImplementedException(); |
||||
} |
||||
} |
||||
|
||||
public bool IsArrayReturnType { |
||||
get { |
||||
throw new NotImplementedException(); |
||||
} |
||||
} |
||||
|
||||
public bool IsGenericReturnType { |
||||
get { |
||||
throw new NotImplementedException(); |
||||
} |
||||
} |
||||
|
||||
public bool IsConstructedReturnType { |
||||
get { |
||||
throw new NotImplementedException(); |
||||
} |
||||
} |
||||
|
||||
public IClass GetUnderlyingClass() |
||||
{ |
||||
throw new NotImplementedException(); |
||||
} |
||||
|
||||
public List<IMethod> GetMethods() |
||||
{ |
||||
return methods; |
||||
} |
||||
|
||||
public List<IProperty> GetProperties() |
||||
{ |
||||
return properties; |
||||
} |
||||
|
||||
public List<IField> GetFields() |
||||
{ |
||||
throw new NotImplementedException(); |
||||
} |
||||
|
||||
public List<IEvent> GetEvents() |
||||
{ |
||||
throw new NotImplementedException(); |
||||
} |
||||
|
||||
public ArrayReturnType CastToArrayReturnType() |
||||
{ |
||||
throw new NotImplementedException(); |
||||
} |
||||
|
||||
public GenericReturnType CastToGenericReturnType() |
||||
{ |
||||
throw new NotImplementedException(); |
||||
} |
||||
|
||||
public ConstructedReturnType CastToConstructedReturnType() |
||||
{ |
||||
throw new NotImplementedException(); |
||||
} |
||||
} |
||||
} |
||||
@ -0,0 +1,276 @@
@@ -0,0 +1,276 @@
|
||||
// <file>
|
||||
// <copyright see="prj:///doc/copyright.txt"/>
|
||||
// <license see="prj:///doc/license.txt"/>
|
||||
// <owner name="Matthew Ward" email="mrward@users.sourceforge.net"/>
|
||||
// <version>$Revision$</version>
|
||||
// </file>
|
||||
|
||||
using System; |
||||
using System.Collections.Generic; |
||||
using ICSharpCode.SharpDevelop.Dom; |
||||
|
||||
namespace ICSharpCode.SharpDevelop.Tests.Utils |
||||
{ |
||||
public class MockMethod : IMethod |
||||
{ |
||||
string name = String.Empty; |
||||
bool overridable; |
||||
bool isConst; |
||||
bool isPrivate; |
||||
IClass declaringType; |
||||
|
||||
public MockMethod(string name) |
||||
{ |
||||
this.name = name; |
||||
} |
||||
|
||||
public IList<ITypeParameter> TypeParameters { |
||||
get { |
||||
throw new NotImplementedException(); |
||||
} |
||||
} |
||||
|
||||
public bool IsConstructor { |
||||
get { |
||||
throw new NotImplementedException(); |
||||
} |
||||
} |
||||
|
||||
public IList<IParameter> Parameters { |
||||
get { |
||||
throw new NotImplementedException(); |
||||
} |
||||
} |
||||
|
||||
public bool IsExtensionMethod { |
||||
get { |
||||
throw new NotImplementedException(); |
||||
} |
||||
} |
||||
|
||||
public string FullyQualifiedName { |
||||
get { |
||||
throw new NotImplementedException(); |
||||
} |
||||
} |
||||
|
||||
public IReturnType DeclaringTypeReference { |
||||
get { |
||||
throw new NotImplementedException(); |
||||
} |
||||
set { |
||||
throw new NotImplementedException(); |
||||
} |
||||
} |
||||
|
||||
public DomRegion Region { |
||||
get { |
||||
throw new NotImplementedException(); |
||||
} |
||||
} |
||||
|
||||
public string Name { |
||||
get { |
||||
return name; |
||||
} |
||||
} |
||||
|
||||
public string Namespace { |
||||
get { |
||||
throw new NotImplementedException(); |
||||
} |
||||
} |
||||
|
||||
public string DotNetName { |
||||
get { |
||||
throw new NotImplementedException(); |
||||
} |
||||
} |
||||
|
||||
public IReturnType ReturnType { |
||||
get { |
||||
throw new NotImplementedException(); |
||||
} |
||||
set { |
||||
throw new NotImplementedException(); |
||||
} |
||||
} |
||||
|
||||
public DomRegion BodyRegion { |
||||
get { |
||||
throw new NotImplementedException(); |
||||
} |
||||
} |
||||
|
||||
public IList<ExplicitInterfaceImplementation> InterfaceImplementations { |
||||
get { |
||||
throw new NotImplementedException(); |
||||
} |
||||
} |
||||
|
||||
public IClass DeclaringType { |
||||
get { |
||||
return declaringType; |
||||
} |
||||
set { |
||||
declaringType = value; |
||||
} |
||||
} |
||||
|
||||
public ModifierEnum Modifiers { |
||||
get { |
||||
throw new NotImplementedException(); |
||||
} |
||||
set { |
||||
throw new NotImplementedException(); |
||||
} |
||||
} |
||||
|
||||
public IList<IAttribute> Attributes { |
||||
get { |
||||
throw new NotImplementedException(); |
||||
} |
||||
} |
||||
|
||||
public string Documentation { |
||||
get { |
||||
throw new NotImplementedException(); |
||||
} |
||||
} |
||||
|
||||
public bool IsAbstract { |
||||
get { |
||||
throw new NotImplementedException(); |
||||
} |
||||
} |
||||
|
||||
public bool IsSealed { |
||||
get { |
||||
throw new NotImplementedException(); |
||||
} |
||||
} |
||||
|
||||
public bool IsStatic { |
||||
get { |
||||
throw new NotImplementedException(); |
||||
} |
||||
} |
||||
|
||||
public bool IsConst { |
||||
get { |
||||
return isConst; |
||||
} |
||||
set { |
||||
isConst = value; |
||||
} |
||||
} |
||||
|
||||
public bool IsVirtual { |
||||
get { |
||||
throw new NotImplementedException(); |
||||
} |
||||
} |
||||
|
||||
public bool IsPublic { |
||||
get { |
||||
throw new NotImplementedException(); |
||||
} |
||||
} |
||||
|
||||
public bool IsProtected { |
||||
get { |
||||
throw new NotImplementedException(); |
||||
} |
||||
} |
||||
|
||||
public bool IsPrivate { |
||||
get { |
||||
return isPrivate; |
||||
} |
||||
set { |
||||
isPrivate = value; |
||||
} |
||||
} |
||||
|
||||
public bool IsInternal { |
||||
get { |
||||
throw new NotImplementedException(); |
||||
} |
||||
} |
||||
|
||||
public bool IsReadonly { |
||||
get { |
||||
throw new NotImplementedException(); |
||||
} |
||||
} |
||||
|
||||
public bool IsProtectedAndInternal { |
||||
get { |
||||
throw new NotImplementedException(); |
||||
} |
||||
} |
||||
|
||||
public bool IsProtectedOrInternal { |
||||
get { |
||||
throw new NotImplementedException(); |
||||
} |
||||
} |
||||
|
||||
public bool IsOverride { |
||||
get { |
||||
throw new NotImplementedException(); |
||||
} |
||||
} |
||||
|
||||
public bool IsOverridable { |
||||
get { |
||||
return overridable; |
||||
} |
||||
set { |
||||
overridable = value; |
||||
} |
||||
} |
||||
|
||||
public bool IsNew { |
||||
get { |
||||
throw new NotImplementedException(); |
||||
} |
||||
} |
||||
|
||||
public bool IsSynthetic { |
||||
get { |
||||
throw new NotImplementedException(); |
||||
} |
||||
} |
||||
|
||||
public object UserData { |
||||
get { |
||||
throw new NotImplementedException(); |
||||
} |
||||
set { |
||||
throw new NotImplementedException(); |
||||
} |
||||
} |
||||
|
||||
public bool IsAccessible(IClass callingClass, bool isClassInInheritanceTree) |
||||
{ |
||||
throw new NotImplementedException(); |
||||
} |
||||
|
||||
public bool MustBeShown(IClass callingClass, bool showStatic, bool isClassInInheritanceTree) |
||||
{ |
||||
throw new NotImplementedException(); |
||||
} |
||||
|
||||
public int CompareTo(object obj) |
||||
{ |
||||
throw new NotImplementedException(); |
||||
} |
||||
|
||||
public object Clone() |
||||
{ |
||||
throw new NotImplementedException(); |
||||
} |
||||
|
||||
} |
||||
} |
||||
@ -0,0 +1,30 @@
@@ -0,0 +1,30 @@
|
||||
// <file>
|
||||
// <copyright see="prj:///doc/copyright.txt"/>
|
||||
// <license see="prj:///doc/license.txt"/>
|
||||
// <owner name="Matthew Ward" email="mrward@users.sourceforge.net"/>
|
||||
// <version>$Revision$</version>
|
||||
// </file>
|
||||
|
||||
using System; |
||||
using ICSharpCode.SharpDevelop.Dom; |
||||
using ICSharpCode.SharpDevelop.Dom.CSharp; |
||||
using ICSharpCode.SharpDevelop.Project; |
||||
|
||||
namespace ICSharpCode.SharpDevelop.Tests.Utils |
||||
{ |
||||
/// <summary>
|
||||
/// Mocks IProject class that returns a dummy ambience.
|
||||
/// </summary>
|
||||
public class MockProject : AbstractProject |
||||
{ |
||||
public MockProject() |
||||
{ |
||||
} |
||||
|
||||
public override IAmbience Ambience { |
||||
get { |
||||
return new MockAmbience(); |
||||
} |
||||
} |
||||
} |
||||
} |
||||
@ -0,0 +1,294 @@
@@ -0,0 +1,294 @@
|
||||
// <file>
|
||||
// <copyright see="prj:///doc/copyright.txt"/>
|
||||
// <license see="prj:///doc/license.txt"/>
|
||||
// <owner name="Matthew Ward" email="mrward@users.sourceforge.net"/>
|
||||
// <version>$Revision$</version>
|
||||
// </file>
|
||||
|
||||
using System; |
||||
using System.Collections.Generic; |
||||
using ICSharpCode.SharpDevelop.Dom; |
||||
|
||||
namespace ICSharpCode.SharpDevelop.Tests.Utils |
||||
{ |
||||
public class MockProperty : IProperty |
||||
{ |
||||
bool overridable; |
||||
bool isConst; |
||||
bool isPrivate; |
||||
IClass declaringType; |
||||
string name = String.Empty; |
||||
|
||||
public MockProperty(string name) |
||||
{ |
||||
this.name = name; |
||||
} |
||||
|
||||
public DomRegion GetterRegion { |
||||
get { |
||||
throw new NotImplementedException(); |
||||
} |
||||
} |
||||
|
||||
public DomRegion SetterRegion { |
||||
get { |
||||
throw new NotImplementedException(); |
||||
} |
||||
} |
||||
|
||||
public bool CanGet { |
||||
get { |
||||
throw new NotImplementedException(); |
||||
} |
||||
} |
||||
|
||||
public bool CanSet { |
||||
get { |
||||
throw new NotImplementedException(); |
||||
} |
||||
} |
||||
|
||||
public bool IsIndexer { |
||||
get { |
||||
throw new NotImplementedException(); |
||||
} |
||||
} |
||||
|
||||
public IList<IParameter> Parameters { |
||||
get { |
||||
throw new NotImplementedException(); |
||||
} |
||||
} |
||||
|
||||
public bool IsExtensionMethod { |
||||
get { |
||||
throw new NotImplementedException(); |
||||
} |
||||
} |
||||
|
||||
public string FullyQualifiedName { |
||||
get { |
||||
throw new NotImplementedException(); |
||||
} |
||||
} |
||||
|
||||
public IReturnType DeclaringTypeReference { |
||||
get { |
||||
throw new NotImplementedException(); |
||||
} |
||||
set { |
||||
throw new NotImplementedException(); |
||||
} |
||||
} |
||||
|
||||
public DomRegion Region { |
||||
get { |
||||
throw new NotImplementedException(); |
||||
} |
||||
} |
||||
|
||||
public string Name { |
||||
get { |
||||
return name; |
||||
} |
||||
} |
||||
|
||||
public string Namespace { |
||||
get { |
||||
throw new NotImplementedException(); |
||||
} |
||||
} |
||||
|
||||
public string DotNetName { |
||||
get { |
||||
throw new NotImplementedException(); |
||||
} |
||||
} |
||||
|
||||
public IReturnType ReturnType { |
||||
get { |
||||
throw new NotImplementedException(); |
||||
} |
||||
set { |
||||
throw new NotImplementedException(); |
||||
} |
||||
} |
||||
|
||||
public DomRegion BodyRegion { |
||||
get { |
||||
throw new NotImplementedException(); |
||||
} |
||||
} |
||||
|
||||
public IList<ExplicitInterfaceImplementation> InterfaceImplementations { |
||||
get { |
||||
throw new NotImplementedException(); |
||||
} |
||||
} |
||||
|
||||
public IClass DeclaringType { |
||||
get { |
||||
return declaringType; |
||||
} |
||||
set { |
||||
declaringType = value; |
||||
} |
||||
} |
||||
|
||||
public ModifierEnum Modifiers { |
||||
get { |
||||
throw new NotImplementedException(); |
||||
} |
||||
set { |
||||
throw new NotImplementedException(); |
||||
} |
||||
} |
||||
|
||||
public IList<IAttribute> Attributes { |
||||
get { |
||||
throw new NotImplementedException(); |
||||
} |
||||
} |
||||
|
||||
public string Documentation { |
||||
get { |
||||
throw new NotImplementedException(); |
||||
} |
||||
} |
||||
|
||||
public bool IsAbstract { |
||||
get { |
||||
throw new NotImplementedException(); |
||||
} |
||||
} |
||||
|
||||
public bool IsSealed { |
||||
get { |
||||
throw new NotImplementedException(); |
||||
} |
||||
} |
||||
|
||||
public bool IsStatic { |
||||
get { |
||||
throw new NotImplementedException(); |
||||
} |
||||
} |
||||
|
||||
public bool IsConst { |
||||
get { |
||||
return isConst; |
||||
} |
||||
set { |
||||
isConst = value; |
||||
} |
||||
} |
||||
|
||||
public bool IsVirtual { |
||||
get { |
||||
throw new NotImplementedException(); |
||||
} |
||||
} |
||||
|
||||
public bool IsPublic { |
||||
get { |
||||
throw new NotImplementedException(); |
||||
} |
||||
} |
||||
|
||||
public bool IsProtected { |
||||
get { |
||||
throw new NotImplementedException(); |
||||
} |
||||
} |
||||
|
||||
public bool IsPrivate { |
||||
get { |
||||
return isPrivate; |
||||
} |
||||
set { |
||||
isPrivate = value; |
||||
} |
||||
} |
||||
|
||||
public bool IsInternal { |
||||
get { |
||||
throw new NotImplementedException(); |
||||
} |
||||
} |
||||
|
||||
public bool IsReadonly { |
||||
get { |
||||
throw new NotImplementedException(); |
||||
} |
||||
} |
||||
|
||||
public bool IsProtectedAndInternal { |
||||
get { |
||||
throw new NotImplementedException(); |
||||
} |
||||
} |
||||
|
||||
public bool IsProtectedOrInternal { |
||||
get { |
||||
throw new NotImplementedException(); |
||||
} |
||||
} |
||||
|
||||
public bool IsOverride { |
||||
get { |
||||
throw new NotImplementedException(); |
||||
} |
||||
} |
||||
|
||||
public bool IsOverridable { |
||||
get { |
||||
return overridable; |
||||
} |
||||
set { |
||||
overridable = value; |
||||
} |
||||
} |
||||
|
||||
public bool IsNew { |
||||
get { |
||||
throw new NotImplementedException(); |
||||
} |
||||
} |
||||
|
||||
public bool IsSynthetic { |
||||
get { |
||||
throw new NotImplementedException(); |
||||
} |
||||
} |
||||
|
||||
public object UserData { |
||||
get { |
||||
throw new NotImplementedException(); |
||||
} |
||||
set { |
||||
throw new NotImplementedException(); |
||||
} |
||||
} |
||||
|
||||
public bool IsAccessible(IClass callingClass, bool isClassInInheritanceTree) |
||||
{ |
||||
throw new NotImplementedException(); |
||||
} |
||||
|
||||
public bool MustBeShown(IClass callingClass, bool showStatic, bool isClassInInheritanceTree) |
||||
{ |
||||
throw new NotImplementedException(); |
||||
} |
||||
|
||||
public int CompareTo(object obj) |
||||
{ |
||||
throw new NotImplementedException(); |
||||
} |
||||
|
||||
public object Clone() |
||||
{ |
||||
throw new NotImplementedException(); |
||||
} |
||||
|
||||
} |
||||
} |
||||
Loading…
Reference in new issue