Browse Source

Added unit test for "Finalizer" method not shown.

newNRvisualizers
Mike Krüger 14 years ago
parent
commit
b5c90d631c
  1. 4
      ICSharpCode.NRefactory.CSharp/Completion/CSharpCompletionEngine.cs
  2. 38
      ICSharpCode.NRefactory.Tests/CSharp/CodeCompletion/CodeCompletionBugTests.cs

4
ICSharpCode.NRefactory.CSharp/Completion/CSharpCompletionEngine.cs

@ -1774,6 +1774,10 @@ namespace ICSharpCode.NRefactory.CSharp.Completion
// Console.WriteLine ("skip non static member: " + member.FullName); // Console.WriteLine ("skip non static member: " + member.FullName);
continue; continue;
} }
if (member is IMethod && ((IMethod)member).FullName == "System.Object.Finalize")
continue;
// Console.WriteLine ("add : "+ member.FullName + " --- " + member.IsStatic); // Console.WriteLine ("add : "+ member.FullName + " --- " + member.IsStatic);
result.AddMember (member); result.AddMember (member);
} }

38
ICSharpCode.NRefactory.Tests/CSharp/CodeCompletion/CodeCompletionBugTests.cs

@ -1655,6 +1655,44 @@ class A
}); });
} }
/// <summary>
/// Bug 2800 - Finalize is offered as a valid completion target
/// </summary>
[Test()]
public void TestBug2800 ()
{
CombinedProviderTest (
@"
class A
{
public void Test()
{
$this.$
}
}
", provider => {
Assert.IsNull (provider.Find ("Finalize"), "'Finalize' found.");
});
}
[Test()]
public void TestBug2800B ()
{
CombinedProviderTest (
@"
class A
{
$public override $
}
", provider => {
Assert.IsNotNull (provider.Find ("ToString"), "'ToString' not found.");
Assert.IsNull (provider.Find ("Finalize"), "'Finalize' found.");
});
}
[Test()] [Test()]
public void TestNewInConstructor () public void TestNewInConstructor ()
{ {

Loading…
Cancel
Save