PageRenderTime 3ms CodeModel.GetById 2ms app.highlight 33ms RepoModel.GetById 1ms app.codeStats 0ms

/NRefactory/ICSharpCode.NRefactory.Tests/CSharp/CodeCompletion/ParameterCompletionTests.cs

https://github.com/davidroth/ILSpy
C# | 981 lines | 834 code | 79 blank | 68 comment | 16 complexity | ce19e4d1aa0e80b11d346dd106bd0816 MD5 | raw file
  1//
  2// ParameterCompletionTests.cs
  3//
  4// Author:
  5//   Mike Krüger <mkrueger@novell.com>
  6//
  7// Copyright (C) 2008 Novell, Inc (http://www.novell.com)
  8//
  9// Permission is hereby granted, free of charge, to any person obtaining
 10// a copy of this software and associated documentation files (the
 11// "Software"), to deal in the Software without restriction, including
 12// without limitation the rights to use, copy, modify, merge, publish,
 13// distribute, sublicense, and/or sell copies of the Software, and to
 14// permit persons to whom the Software is furnished to do so, subject to
 15// the following conditions:
 16// 
 17// The above copyright notice and this permission notice shall be
 18// included in all copies or substantial portions of the Software.
 19// 
 20// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 21// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 22// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 23// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
 24// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
 25// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 26// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 27//
 28
 29using System;
 30using System.Collections.Generic;
 31using NUnit.Framework;
 32using ICSharpCode.NRefactory.Completion;
 33using ICSharpCode.NRefactory.CSharp.Completion;
 34using ICSharpCode.NRefactory.Editor;
 35using ICSharpCode.NRefactory.TypeSystem.Implementation;
 36using ICSharpCode.NRefactory.TypeSystem;
 37using System.Linq;
 38using ICSharpCode.NRefactory.CSharp.TypeSystem;
 39
 40namespace ICSharpCode.NRefactory.CSharp.CodeCompletion
 41{
 42	[TestFixture()]
 43	public class ParameterCompletionTests : TestBase
 44	{
 45		class TestFactory : IParameterCompletionDataFactory
 46		{
 47			IProjectContent ctx;
 48			
 49			public TestFactory (IProjectContent ctx)
 50			{
 51				this.ctx = ctx;
 52			}
 53			
 54			class Provider : IParameterDataProvider
 55			{
 56				public IEnumerable<IMethod> Data { get; set; }
 57				#region IParameterDataProvider implementation
 58				public int StartOffset { get { return 0; } }
 59				
 60				public string GetHeading (int overload, string[] parameterDescription, int currentParameter)
 61				{
 62					return "";
 63				}
 64
 65				public string GetDescription (int overload, int currentParameter)
 66				{
 67					return "";
 68				}
 69
 70				public string GetParameterDescription (int overload, int paramIndex)
 71				{
 72					return "";
 73				}
 74
 75				public int GetParameterCount (int overload)
 76				{
 77					var method = Data.ElementAt (overload);
 78					return method.Parameters.Count;
 79				}
 80
 81				public bool AllowParameterList (int overload)
 82				{
 83					return false;
 84				}
 85
 86				public int Count {
 87					get {
 88						return Data.Count ();
 89					}
 90				}
 91				#endregion
 92			}
 93			
 94			class IndexerProvider : IParameterDataProvider
 95			{
 96				public IEnumerable<IProperty> Data { get; set; }
 97				
 98				#region IParameterDataProvider implementation
 99				public int StartOffset { get { return 0; } }
100
101				public string GetHeading (int overload, string[] parameterDescription, int currentParameter)
102				{
103					return "";
104				}
105
106				public string GetDescription (int overload, int currentParameter)
107				{
108					return "";
109				}
110
111				public string GetParameterDescription (int overload, int paramIndex)
112				{
113					return "";
114				}
115
116				public int GetParameterCount (int overload)
117				{
118					var method = Data.ElementAt (overload);
119					return method.Parameters.Count;
120				}
121
122				public bool AllowParameterList (int overload)
123				{
124					return false;
125				}
126
127				public int Count {
128					get {
129						return Data.Count ();
130					}
131				}
132				#endregion
133			}
134			
135			
136			class ArrayProvider : IParameterDataProvider
137			{
138				#region IParameterDataProvider implementation
139				public int StartOffset { get { return 0; } }
140
141				public string GetHeading (int overload, string[] parameterDescription, int currentParameter)
142				{
143					return "";
144				}
145
146				public string GetDescription (int overload, int currentParameter)
147				{
148					return "";
149				}
150
151				public string GetParameterDescription (int overload, int paramIndex)
152				{
153					return "";
154				}
155
156				public int GetParameterCount (int overload)
157				{
158					return 1;
159				}
160
161				public bool AllowParameterList (int overload)
162				{
163					return false;
164				}
165
166				public int Count {
167					get {
168						return 1;
169					}
170				}
171				#endregion
172			}
173			
174			class TypeParameterDataProvider : IParameterDataProvider
175			{
176				public IEnumerable<IType> Data { get; set; }
177				#region IParameterDataProvider implementation
178				public int StartOffset { get { return 0; } }
179
180				public string GetHeading (int overload, string[] parameterDescription, int currentParameter)
181				{
182					return "";
183				}
184
185				public string GetDescription (int overload, int currentParameter)
186				{
187					return "";
188				}
189
190				public string GetParameterDescription (int overload, int paramIndex)
191				{
192					return "";
193				}
194
195				public int GetParameterCount (int overload)
196				{
197					var data = Data.ElementAt (overload);
198					return data.TypeParameterCount;
199				}
200
201				public bool AllowParameterList (int overload)
202				{
203					return false;
204				}
205
206				public int Count {
207					get {
208						return Data.Count ();
209					}
210				}
211				#endregion
212			}
213			
214			#region IParameterCompletionDataFactory implementation
215			public IParameterDataProvider CreateConstructorProvider(int startOffset, ICSharpCode.NRefactory.TypeSystem.IType type)
216			{
217				Assert.IsTrue(type.Kind != TypeKind.Unknown);
218				return new Provider () {
219					Data = type.GetConstructors (m => m.Accessibility == Accessibility.Public)
220				};
221			}
222
223			public IParameterDataProvider CreateMethodDataProvider (int startOffset, IEnumerable<IMethod> methods)
224			{
225				return new Provider () {
226					Data = methods
227				};
228			}
229
230			public IParameterDataProvider CreateDelegateDataProvider(int startOffset, ICSharpCode.NRefactory.TypeSystem.IType type)
231			{
232				Assert.IsTrue(type.Kind != TypeKind.Unknown);
233				return new Provider () {
234					Data = new [] { type.GetDelegateInvokeMethod () }
235				};
236			}
237			
238			public IParameterDataProvider CreateIndexerParameterDataProvider(int startOffset, IType type, AstNode resolvedNode)
239			{
240				Assert.IsTrue(type.Kind != TypeKind.Unknown);
241				if (type.Kind == TypeKind.Array)
242					return new ArrayProvider ();
243				return new IndexerProvider () {
244					Data = type.GetProperties (p => p.IsIndexer)
245				};
246			}
247			
248			public IParameterDataProvider CreateTypeParameterDataProvider (int startOffset, IEnumerable<IType> types)
249			{
250				return new TypeParameterDataProvider () {
251					Data = types
252				};
253			}
254			#endregion
255		}
256		
257		internal static IParameterDataProvider CreateProvider(string text)
258		{
259			string parsedText;
260			string editorText;
261			int cursorPosition = text.IndexOf('$');
262			int endPos = text.IndexOf('$', cursorPosition + 1);
263			if (endPos == -1) {
264				parsedText = editorText = text.Substring(0, cursorPosition) + text.Substring(cursorPosition + 1);
265			} else {
266				parsedText = text.Substring(0, cursorPosition) + new string(' ', endPos - cursorPosition) + text.Substring(endPos + 1);
267				editorText = text.Substring(0, cursorPosition) + text.Substring(cursorPosition + 1, endPos - cursorPosition - 1) + text.Substring(endPos + 1);
268				cursorPosition = endPos - 1; 
269			}
270			var doc = new ReadOnlyDocument(editorText);
271			
272			IProjectContent pctx = new CSharpProjectContent();
273			pctx = pctx.AddAssemblyReferences(new [] { CecilLoaderTests.Mscorlib, CecilLoaderTests.SystemCore });
274			
275			var syntaxTree = new CSharpParser().Parse(parsedText, "program.cs");
276			syntaxTree.Freeze();
277			
278			var unresolvedFile = syntaxTree.ToTypeSystem();
279			pctx = pctx.AddOrUpdateFiles(unresolvedFile);
280			var cmp = pctx.CreateCompilation();
281			var loc = doc.GetLocation(cursorPosition);
282			
283			
284			var rctx = new CSharpTypeResolveContext(cmp.MainAssembly);
285			rctx = rctx.WithUsingScope(unresolvedFile.GetUsingScope(loc).Resolve(cmp));
286			var curDef = unresolvedFile.GetInnermostTypeDefinition(loc);
287			if (curDef != null) {
288				rctx = rctx.WithCurrentTypeDefinition(curDef.Resolve(rctx).GetDefinition());
289				var curMember = unresolvedFile.GetMember(loc);
290				if (curMember != null) {
291					rctx = rctx.WithCurrentMember(curMember.CreateResolved(rctx));
292				}
293			}
294			var mb = new DefaultCompletionContextProvider(doc, unresolvedFile);
295			var engine = new CSharpParameterCompletionEngine (doc, mb, new TestFactory (pctx), pctx, rctx);
296			return engine.GetParameterDataProvider (cursorPosition, doc.GetCharAt (cursorPosition - 1));
297		}
298		
299		/// <summary>
300		/// Bug 427448 - Code Completion: completion of constructor parameters not working
301		/// </summary>
302		[Test()]
303		public void TestBug427448 ()
304		{
305			IParameterDataProvider provider = CreateProvider (
306@"class Test
307{
308	public Test (int a)
309	{
310	}
311	
312	public Test (string b)
313	{
314	}
315	protected Test ()
316	{
317	}
318	Test (double d, float m)
319	{
320	}
321}
322
323class AClass
324{
325	void A()
326	{
327		$Test t = new Test ($
328	}
329}");
330			Assert.IsNotNull (provider, "provider was not created.");
331			Assert.AreEqual (2, provider.Count);
332		}
333
334		/// <summary>
335		/// Bug 432437 - No completion when invoking delegates
336		/// </summary>
337		[Test()]
338		public void TestBug432437 ()
339		{
340			IParameterDataProvider provider = CreateProvider (
341@"public delegate void MyDel (int value);
342
343class Test
344{
345	MyDel d;
346
347	void A()
348	{
349		$d ($
350	}
351}");
352			Assert.IsNotNull (provider, "provider was not created.");
353			Assert.AreEqual (1, provider.Count);
354		}
355
356		/// <summary>
357		/// Bug 432658 - Incorrect completion when calling an extension method from inside another extension method
358		/// </summary>
359		[Test()]
360		public void TestBug432658 ()
361		{
362			IParameterDataProvider provider = CreateProvider (
363@"static class Extensions
364{
365	public static void Ext1 (this int start)
366	{
367	}
368	public static void Ext2 (this int end)
369	{
370		$Ext1($
371	}
372}");
373			Assert.IsNotNull (provider, "provider was not created.");
374			Assert.AreEqual (1, provider.Count, "There should be one overload");
375			Assert.AreEqual (1, provider.GetParameterCount(0), "Parameter 'start' should exist");
376		}
377
378		/// <summary>
379		/// Bug 432727 - No completion if no constructor
380		/// </summary>
381		[Test()]
382		public void TestBug432727 ()
383		{
384			IParameterDataProvider provider = CreateProvider (
385@"class A
386{
387	void Method ()
388	{
389		$A aTest = new A ($
390	}
391}");
392			Assert.IsNotNull (provider, "provider was not created.");
393			Assert.AreEqual (1, provider.Count);
394		}
395
396		/// <summary>
397		/// Bug 434705 - No autocomplete offered if not assigning result of 'new' to a variable
398		/// </summary>
399		[Test()]
400		public void TestBug434705 ()
401		{
402			IParameterDataProvider provider = CreateProvider (
403@"class Test
404{
405	public Test (int a)
406	{
407	}
408}
409
410class AClass
411{
412	Test A()
413	{
414		$return new Test ($
415	}
416}");
417			Assert.IsNotNull (provider, "provider was not created.");
418			Assert.AreEqual (1, provider.Count);
419		}
420		
421		/// <summary>
422		/// Bug 434705 - No autocomplete offered if not assigning result of 'new' to a variable
423		/// </summary>
424		[Test()]
425		public void TestBug434705B ()
426		{
427			IParameterDataProvider provider = CreateProvider (
428@"
429class Test<T>
430{
431	public Test (T t)
432	{
433	}
434}
435class TestClass
436{
437	void TestMethod ()
438	{
439		$Test<int> l = new Test<int> ($
440	}
441}");
442			Assert.IsNotNull (provider, "provider was not created.");
443			Assert.AreEqual (1, provider.Count);
444		}
445	
446		
447		/// <summary>
448		/// Bug 434701 - No autocomplete in attributes
449		/// </summary>
450		[Test()]
451		public void TestBug434701 ()
452		{
453			IParameterDataProvider provider = CreateProvider (
454@"namespace Test {
455class TestAttribute : System.Attribute
456{
457	public Test (int a)
458	{
459	}
460}
461
462$[Test ($
463class AClass
464{
465}
466}");
467			Assert.IsNotNull (provider, "provider was not created.");
468			Assert.AreEqual (1, provider.Count);
469		}
470		
471		/// <summary>
472		/// Bug 447985 - Exception display tip is inaccurate for derived (custom) exceptions
473		/// </summary>
474		[Test()]
475		public void TestBug447985 ()
476		{
477			IParameterDataProvider provider = CreateProvider (
478@"
479namespace System {
480	public class Exception
481	{
482		public Exception () {}
483	}
484}
485
486class MyException : System.Exception
487{
488	public MyException (int test)
489	{}
490}
491
492class AClass
493{
494	public void Test ()
495	{
496		$throw new MyException($
497	}
498
499}");
500			Assert.IsNotNull (provider, "provider was not created.");
501			Assert.AreEqual (1, provider.Count);
502			Assert.AreEqual (1, provider.GetParameterCount(0), "Parameter 'test' should exist");
503		}
504		
505		
506		/// <summary>
507		/// Bug 1760 - [New Resolver] Parameter tooltip not shown for indexers 
508		/// </summary>
509		[Test()]
510		public void Test1760 ()
511		{
512			var provider = CreateProvider (
513@"
514class TestClass
515{
516	public static void Main (string[] args)
517	{
518		$args[$
519	}
520}");
521			Assert.IsNotNull (provider, "provider was not created.");
522			Assert.AreEqual (1, provider.Count);
523		}
524		
525		[Test()]
526		public void TestSecondIndexerParameter ()
527		{
528			var provider = CreateProvider (
529@"
530class TestClass
531{
532	public int this[int i, int j] { get { return 0; } } 
533	public void Test ()
534	{
535		$this[1,$
536	}
537}");
538			Assert.IsNotNull (provider, "provider was not created.");
539			Assert.AreEqual (1, provider.Count);
540		}
541		
542		[Test()]
543		public void TestSecondMethodParameter ()
544		{
545			var provider = CreateProvider (
546@"
547class TestClass
548{
549	public int TestMe (int i, int j) { return 0; } 
550	public void Test ()
551	{
552		$TestMe (1,$
553	}
554}");
555			Assert.IsNotNull (provider, "provider was not created.");
556			Assert.AreEqual (1, provider.Count);
557		}
558		
559		
560		/// Bug 599 - Regression: No intellisense over Func delegate
561		[Test()]
562		public void TestBug599 ()
563		{
564			var provider = CreateProvider (
565@"using System;
566using System.Core;
567
568class TestClass
569{
570	void A (Func<int, int> f)
571	{
572		$f ($
573	}
574}");
575			Assert.IsNotNull (provider, "provider was not created.");
576			Assert.AreEqual (1, provider.Count);
577		}
578		
579		/// Bug 3307 - Chained linq methods do not work correctly
580		[Test()]
581		public void TestBug3307 ()
582		{
583			var provider = CreateProvider (
584@"using System;
585using System.Linq;
586
587class TestClass
588{
589	public static void Main (string[] args)
590	{
591		$args.Select ($
592	}
593}");
594			Assert.IsNotNull (provider, "provider was not created.");
595			Assert.IsTrue (provider.Count > 0);
596		}
597		
598		[Test()]
599		public void TestBug3307FollowUp ()
600		{
601			var provider = CodeCompletionBugTests.CreateProvider (
602@"using System;
603using System.Linq;
604
605public class MainClass
606{
607	static void TestMe (Action<int> act)
608	{
609	}
610	
611	public static void Main (string[] args)
612	{
613		$TestMe (x$
614	}
615}");
616			Assert.IsNotNull (provider, "provider was not created.");
617			Assert.IsFalse (provider.AutoSelect, "auto select enabled !");
618		}
619		
620		[Test()]
621		public void TestBug3307FollowUp2 ()
622		{
623			var provider = CodeCompletionBugTests.CreateProvider (
624@"using System;
625using System.Linq;
626
627public class MainClass
628{
629	public static void Main (string[] args)
630	{
631		$args.Select (x$
632	}
633}");
634			Assert.IsNotNull (provider, "provider was not created.");
635			Assert.IsFalse (provider.AutoSelect, "auto select enabled !");
636		}
637		
638		[Test()]
639		public void TestConstructor ()
640		{
641			IParameterDataProvider provider = CreateProvider (
642@"class Foo { public Foo (int a) {} }
643
644class A
645{
646	void Method ()
647	{
648		$Bar = new Foo ($
649	}
650}");
651			Assert.IsNotNull (provider, "provider was not created.");
652			Assert.AreEqual (1, provider.Count);
653		}
654		
655		
656		[Test()]
657		public void TestConstructorCase2 ()
658		{
659			IParameterDataProvider provider = CreateProvider (
660@"
661namespace Test 
662{
663	struct TestMe 
664	{
665		public TestMe (string a)
666		{
667		}
668	}
669	
670	class A
671	{
672		void Method ()
673		{
674			$new TestMe ($
675		}
676	}
677}");
678			Assert.IsNotNull (provider, "provider was not created.");
679			Assert.AreEqual (2, provider.Count);
680		}
681		
682		[Test()]
683		public void TestTypeParameter ()
684		{
685			IParameterDataProvider provider = CreateProvider (
686@"using System;
687
688namespace Test 
689{
690	class A
691	{
692		void Method ()
693		{
694			$Action<$
695		}
696	}
697}");
698			Assert.IsNotNull (provider, "provider was not created.");
699			Assert.AreEqual (16, provider.Count);
700		}
701		
702		[Test()]
703		public void TestSecondTypeParameter ()
704		{
705			IParameterDataProvider provider = CreateProvider (
706@"using System;
707
708namespace Test 
709{
710	class A
711	{
712		void Method ()
713		{
714			$Action<string,$
715		}
716	}
717}");
718			Assert.IsNotNull (provider, "provider was not created.");
719			Assert.AreEqual (16, provider.Count);
720		}
721		
722		[Ignore("TODO")]
723		[Test()]
724		public void TestMethodTypeParameter ()
725		{
726			IParameterDataProvider provider = CreateProvider (
727@"using System;
728
729namespace Test 
730{
731	class A
732	{
733		void TestMethod<T, S>()
734		{
735		}
736
737		void Method ()
738		{
739			$TestMethod<$
740		}
741	}
742}");
743			Assert.IsNotNull (provider, "provider was not created.");
744			Assert.AreEqual (1, provider.Count);
745		}
746		
747		[Ignore("TODO")]
748		[Test()]
749		public void TestSecondMethodTypeParameter ()
750		{
751			IParameterDataProvider provider = CreateProvider (
752@"using System;
753
754namespace Test 
755{
756	class A
757	{
758		void TestMethod<T, S>()
759		{
760		}
761
762		void Method ()
763		{
764			$TestMethod<string,$
765		}
766	}
767}");
768			Assert.IsNotNull (provider, "provider was not created.");
769			Assert.AreEqual (1, provider.Count);
770		}		
771	
772		[Test()]
773		public void TestArrayParameter ()
774		{
775			var provider = CreateProvider (
776@"
777class TestClass
778{
779	public void Method()
780	{
781		int[,,,] arr;
782		$arr[$
783	}
784}");
785			Assert.IsNotNull (provider, "provider was not created.");
786			Assert.AreEqual (1, provider.Count);
787		}
788		
789		[Test()]
790		public void TestSecondArrayParameter ()
791		{
792			var provider = CreateProvider (
793@"
794class TestClass
795{
796	public void Method()
797	{
798		int[,,,] arr;
799		$arr[5,$
800	}
801}");
802			Assert.IsNotNull (provider, "provider was not created.");
803			Assert.AreEqual (1, provider.Count);
804		}
805		
806		[Ignore("TODO!")]
807		[Test()]
808		public void TestTypeParameterInBaseType ()
809		{
810			IParameterDataProvider provider = CreateProvider (
811@"using System;
812
813namespace Test 
814{
815	$class A : Tuple<$
816}");
817			Assert.IsNotNull (provider, "provider was not created.");
818			Assert.AreEqual (16, provider.Count);
819		}
820		
821		
822		[Test()]
823		public void TestBaseConstructorCall ()
824		{
825			IParameterDataProvider provider = CreateProvider (
826@"class Base
827{
828	public Base (int i)
829	{
830			
831	}
832	public Base (int i, string s)
833	{
834			
835	}
836}
837
838namespace Test 
839{
840	class A : Base
841	{
842		$public A () : base($
843	}
844}");
845			Assert.IsNotNull (provider, "provider was not created.");
846			Assert.AreEqual (2, provider.Count);
847		}
848		
849		[Test()]
850		public void TestThisConstructorCall ()
851		{
852			IParameterDataProvider provider = CreateProvider (
853@"class Base
854{
855	public Base (int i)
856	{
857			
858	}
859	public Base (int i, string s)
860	{
861			
862	}
863}
864
865namespace Test 
866{
867	class A : Base
868	{
869		public A (int a, int b) : base(a) {}
870
871		$public A () : this($
872	}
873}");
874			Assert.IsNotNull (provider, "provider was not created.");
875			Assert.AreEqual (1, provider.Count);
876		}
877		
878		/// <summary>
879		/// Bug 3645 - [New Resolver]Parameter completion shows all static and non-static overloads
880		/// </summary>
881		[Test()]
882		public void TestBug3645 ()
883		{
884			IParameterDataProvider provider = CreateProvider (
885@"class Main
886{
887	public static void FooBar (string str)
888	{
889	}
890	
891	public void FooBar (int i)
892	{
893		
894	}
895	
896	public static void Main (string[] args)
897	{
898		$FooBar ($
899	}
900}");
901			Assert.IsNotNull (provider, "provider was not created.");
902			Assert.AreEqual (1, provider.Count);
903		}
904
905		/// <summary>
906		/// Bug 3991 - constructor argument completion not working for attributes applied to methods or parameters
907		/// </summary>
908		[Test()]
909		public void TestBug3991()
910		{
911			IParameterDataProvider provider = CreateProvider(
912@"using System;
913namespace Test
914{
915	class TestClass
916	{
917		[Obsolete$($]
918		TestClass()
919		{
920		}
921	}
922}
923");
924			Assert.IsNotNull(provider, "provider was not created.");
925			Assert.Greater(provider.Count, 0);
926		}
927
928		/// <summary>
929		/// Bug 4087 - code completion handles object and collection initializers (braces) incorrectly in method calls
930		/// </summary>
931		[Test()]
932		public void TestBug4087()
933		{
934			IParameterDataProvider provider = CreateProvider(
935@"using System;
936class TestClass
937{
938	TestClass()
939	{
940		$Console.WriteLine (new int[]{ 4, 5,$
941	}
942}
943");
944			Assert.IsTrue (provider == null || provider.Count == 0);
945		}
946
947		/// <summary>
948		/// Bug 4927 - [New Resolver] Autocomplete shows non-static methods when using class name
949		/// </summary>
950		[Test()]
951		public void TestBug4927 ()
952		{
953			IParameterDataProvider provider = CreateProvider (
954@"
955public class A
956{
957  // static method
958  public static void Method(string someParameter, object anotherParameter)
959  {
960  }
961
962  // instance method
963  public void Method()
964  {
965  }
966}
967
968
969public class B
970{
971  public static void Main()
972  {
973    $A.Method($
974  }
975}
976");
977			Assert.IsNotNull (provider, "provider was not created.");
978			Assert.AreEqual (1, provider.Count);
979		}
980	}
981}