~ubuntu-branches/ubuntu/utopic/monodevelop/utopic

« back to all changes in this revision

Viewing changes to src/addins/CSharpBinding/MonoDevelop.CSharp.UnitTests/UnitTestTextEditorExtension.cs

  • Committer: Package Import Robot
  • Author(s): Jo Shields
  • Date: 2013-10-10 14:50:04 UTC
  • mfrom: (10.3.4)
  • Revision ID: package-import@ubuntu.com-20131010145004-80l130sny21b17sb
Tags: 4.0.12+dfsg-1
* [5dcb6e1] Fix debian/watch for new source tarball name format
* [5c68cb5] Refresh list of files removed by get-orig-source to 
  reflect 4.0.12
* [96d60a0] Imported Upstream version 4.0.12+dfsg
* [b989752] Refresh debian/patches/no_appmenu to ensure it applies
* [2a4c351] Ensure every assembly in external/ is cleaned properly
* [92762f7] Add more excluded Mac-specific modulerefs
* [bc698ba] Add symlinks to NUnit assemblies (Closes: #714246)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
//
 
2
// UnitTestTextEditorExtension.cs
 
3
//
 
4
// Author:
 
5
//       Mike Krüger <mkrueger@xamarin.com>
 
6
//
 
7
// Copyright (c) 2013 Xamarin Inc. (http://xamarin.com)
 
8
//
 
9
// Permission is hereby granted, free of charge, to any person obtaining a copy
 
10
// of this software and associated documentation files (the "Software"), to deal
 
11
// in the Software without restriction, including without limitation the rights
 
12
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 
13
// copies of the Software, and to permit persons to whom the Software is
 
14
// furnished to do so, subject to the following conditions:
 
15
//
 
16
// The above copyright notice and this permission notice shall be included in
 
17
// all copies or substantial portions of the Software.
 
18
//
 
19
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 
20
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 
21
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 
22
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 
23
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 
24
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 
25
// THE SOFTWARE.
 
26
using System;
 
27
using MonoDevelop.Ide.Gui.Content;
 
28
using ICSharpCode.NRefactory.CSharp;
 
29
using MonoDevelop.Refactoring;
 
30
using ICSharpCode.NRefactory.CSharp.Resolver;
 
31
using System.Collections.Generic;
 
32
using System.Threading.Tasks;
 
33
using System.Threading;
 
34
using System.Linq;
 
35
using Mono.TextEditor;
 
36
using MonoDevelop.NUnit;
 
37
using MonoDevelop.Core;
 
38
using MonoDevelop.Ide.Tasks;
 
39
using MonoDevelop.Ide;
 
40
using MonoDevelop.Components.Docking;
 
41
using ICSharpCode.NRefactory.Semantics;
 
42
using ICSharpCode.NRefactory.TypeSystem;
 
43
using MonoDevelop.Components.Commands;
 
44
using Gdk;
 
45
using Gtk;
 
46
using System.Text;
 
47
using MonoDevelop.AnalysisCore;
 
48
 
 
49
namespace MonoDevelop.CSharp
 
50
{
 
51
        class UnitTestTextEditorExtension : TextEditorExtension
 
52
        {
 
53
                public override void Initialize ()
 
54
                {
 
55
                        base.Initialize ();
 
56
                        Document.DocumentParsed += HandleDocumentParsed; 
 
57
                }
 
58
 
 
59
                public override void Dispose ()
 
60
                {
 
61
                        RemoveHandler ();
 
62
                        Document.DocumentParsed -= HandleDocumentParsed; 
 
63
                        base.Dispose ();
 
64
                }
 
65
 
 
66
                CancellationTokenSource src = new CancellationTokenSource ();
 
67
 
 
68
                void HandleDocumentParsed (object sender, EventArgs e)
 
69
                {
 
70
                        if (!AnalysisOptions.EnableUnitTestEditorIntegration)
 
71
                                return;
 
72
                        src.Cancel ();
 
73
                        src = new CancellationTokenSource ();
 
74
                        var token = src.Token;
 
75
                        ThreadPool.QueueUserWorkItem (delegate {
 
76
                                var resolver = document.GetSharedResolver ();
 
77
                                if (resolver.Result == null)
 
78
                                        return;
 
79
                                var visitor = new NUnitVisitor (resolver.Result);
 
80
                                try {
 
81
                                        visitor.VisitSyntaxTree (document.ParsedDocument.GetAst<SyntaxTree> ());
 
82
                                } catch (Exception ex) {
 
83
                                        LoggingService.LogError ("Exception while analyzing ast for unit tests.", ex);
 
84
                                        return;
 
85
                                }
 
86
                                if (token.IsCancellationRequested)
 
87
                                        return;
 
88
                                Application.Invoke (delegate {
 
89
                                        if (document.Editor.Parent.ActionMargin.IsVisible ^ (visitor.FoundTests.Count > 0))
 
90
                                                document.Editor.Parent.QueueDraw ();
 
91
                                        document.Editor.Parent.ActionMargin.IsVisible = visitor.FoundTests.Count > 0;
 
92
 
 
93
                                        foreach (var oldMarker in currentMarker)
 
94
                                                document.Editor.Document.RemoveMarker (oldMarker);
 
95
 
 
96
                                        foreach (var foundTest in visitor.FoundTests) {
 
97
                                                if (token.IsCancellationRequested)
 
98
                                                        return;
 
99
                                                var unitTestMarker = new UnitTestMarker (foundTest, document);
 
100
                                                currentMarker.Add (unitTestMarker);
 
101
                                                document.Editor.Document.AddMarker (foundTest.LineNumber, unitTestMarker);
 
102
                                        }
 
103
                                });
 
104
                        });
 
105
                }
 
106
 
 
107
                
 
108
                static uint timeoutHandler;
 
109
 
 
110
                static void RemoveHandler ()
 
111
                {
 
112
                        if (timeoutHandler != 0) {
 
113
                                GLib.Source.Remove (timeoutHandler); 
 
114
                                timeoutHandler = 0;
 
115
                        }
 
116
                }
 
117
 
 
118
                List<UnitTestMarker> currentMarker = new List<UnitTestMarker>();
 
119
 
 
120
                class UnitTestMarker : MarginMarker
 
121
                {
 
122
                        readonly NUnitVisitor.UnitTest unitTest;
 
123
                        readonly MonoDevelop.Ide.Gui.Document doc;
 
124
 
 
125
                        public UnitTestMarker(NUnitVisitor.UnitTest unitTest, MonoDevelop.Ide.Gui.Document doc)
 
126
                        {
 
127
                                this.unitTest = unitTest;
 
128
                                this.doc = doc;
 
129
                        }
 
130
 
 
131
                        public override bool CanDrawForeground (Margin margin)
 
132
                        {
 
133
                                return margin is ActionMargin;
 
134
                        }
 
135
 
 
136
                        public override void InformMouseHover (TextEditor editor, Margin margin, MarginMouseEventArgs args)
 
137
                        {
 
138
                                string toolTip;
 
139
                                if (unitTest.IsFixture) {
 
140
                                        if (isFailed) {
 
141
                                                toolTip = GettextCatalog.GetString ("NUnit Fixture failed (click to run)");
 
142
                                                if (!string.IsNullOrEmpty (failMessage))
 
143
                                                        toolTip += Environment.NewLine + failMessage.TrimEnd ();
 
144
                                        } else {
 
145
                                                toolTip = GettextCatalog.GetString ("NUnit Fixture (click to run)");
 
146
                                        }
 
147
                                } else {
 
148
                                        if (isFailed) {
 
149
                                                toolTip = GettextCatalog.GetString ("NUnit Test failed (click to run)");
 
150
                                                if (!string.IsNullOrEmpty (failMessage))
 
151
                                                        toolTip += Environment.NewLine + failMessage.TrimEnd ();
 
152
                                                foreach (var id in unitTest.TestCases) {
 
153
                                                        var test = NUnitService.Instance.SearchTestById (unitTest.UnitTestIdentifier + id);
 
154
                                                        if (test != null) {
 
155
                                                                var result = test.GetLastResult ();
 
156
                                                                if (result.IsFailure) {
 
157
                                                                        if (!string.IsNullOrEmpty (result.Message)) {
 
158
                                                                                toolTip += Environment.NewLine + "Test" + id +":";
 
159
                                                                                toolTip += Environment.NewLine + result.Message.TrimEnd ();
 
160
                                                                        }
 
161
                                                                }
 
162
                                                        }
 
163
 
 
164
                                                }
 
165
                                        } else {
 
166
                                                toolTip = GettextCatalog.GetString ("NUnit Test (click to run)");
 
167
                                        }
 
168
 
 
169
                                }
 
170
                                editor.TooltipText = toolTip;
 
171
                        }
 
172
 
 
173
                        static Gtk.Menu menu;
 
174
 
 
175
                        public override void InformMousePress (TextEditor editor, Margin margin, MarginMouseEventArgs args)
 
176
                        {
 
177
                                if (menu != null) {
 
178
                                        menu.Destroy ();
 
179
                                }
 
180
                                var debugModeSet = Runtime.ProcessService.GetDebugExecutionMode ();
 
181
 
 
182
                                menu = new Gtk.Menu ();
 
183
                                if (unitTest.IsFixture) {
 
184
                                        var menuItem = new Gtk.MenuItem ("_Run All");
 
185
                                        menuItem.Activated += new TestRunner (doc, unitTest.UnitTestIdentifier, false).Run;
 
186
                                        menu.Add (menuItem);
 
187
                                        if (debugModeSet != null) {
 
188
                                                menuItem = new Gtk.MenuItem ("_Debug All");
 
189
                                                menuItem.Activated += new TestRunner (doc, unitTest.UnitTestIdentifier, true).Run;
 
190
                                                menu.Add (menuItem);
 
191
                                        }
 
192
                                } else {
 
193
                                        if (unitTest.TestCases.Count == 0) {
 
194
                                                var menuItem = new Gtk.MenuItem ("_Run");
 
195
                                                menuItem.Activated += new TestRunner (doc, unitTest.UnitTestIdentifier, false).Run;
 
196
                                                menu.Add (menuItem);
 
197
                                                if (debugModeSet != null) {
 
198
                                                        menuItem = new Gtk.MenuItem ("_Debug");
 
199
                                                        menuItem.Activated += new TestRunner (doc, unitTest.UnitTestIdentifier, true).Run;
 
200
                                                        menu.Add (menuItem);
 
201
                                                }
 
202
                                        } else {
 
203
                                                var menuItem = new Gtk.MenuItem ("_Run All");
 
204
                                                menuItem.Activated += new TestRunner (doc, unitTest.UnitTestIdentifier, false).Run;
 
205
                                                menu.Add (menuItem);
 
206
                                                if (debugModeSet != null) {
 
207
                                                        menuItem = new Gtk.MenuItem ("_Debug All");
 
208
                                                        menuItem.Activated += new TestRunner (doc, unitTest.UnitTestIdentifier, true).Run;
 
209
                                                        menu.Add (menuItem);
 
210
                                                }
 
211
                                                menu.Add (new Gtk.SeparatorMenuItem ());
 
212
                                                foreach (var id in unitTest.TestCases) {
 
213
                                                        var submenu = new Gtk.Menu ();
 
214
                                                        menuItem = new Gtk.MenuItem ("_Run");
 
215
                                                        menuItem.Activated += new TestRunner (doc, unitTest.UnitTestIdentifier + id, false).Run;
 
216
                                                        submenu.Add (menuItem);
 
217
                                                        if (debugModeSet != null) {
 
218
                                                                menuItem = new Gtk.MenuItem ("_Debug");
 
219
                                                                menuItem.Activated += new TestRunner (doc, unitTest.UnitTestIdentifier + id, true).Run;
 
220
                                                                submenu.Add (menuItem);
 
221
                                                        }
 
222
 
 
223
                                                        var label = "Test" + id;
 
224
                                                        string tooltip = null;
 
225
                                                        var test = NUnitService.Instance.SearchTestById (unitTest.UnitTestIdentifier + id);
 
226
                                                        if (test != null) {
 
227
                                                                var result = test.GetLastResult ();
 
228
                                                                if (result != null && result.IsFailure) {
 
229
                                                                        tooltip = result.Message;
 
230
                                                                        label += "!";
 
231
                                                                }
 
232
                                                        }
 
233
 
 
234
                                                        var subMenuItem = new Gtk.MenuItem (label);
 
235
                                                        if (!string.IsNullOrEmpty (tooltip))
 
236
                                                                subMenuItem.TooltipText = tooltip;
 
237
                                                        subMenuItem.Submenu = submenu;
 
238
                                                        menu.Add (subMenuItem);
 
239
                                                }
 
240
                                        }
 
241
                                }
 
242
                                menu.ShowAll ();
 
243
                                editor.TextArea.ResetMouseState (); 
 
244
                                GtkWorkarounds.ShowContextMenu (menu, editor, new Gdk.Rectangle ((int)args.X, (int)args.Y, 1, 1));
 
245
                        }
 
246
 
 
247
                        class TestRunner
 
248
                        {
 
249
                                readonly MonoDevelop.Ide.Gui.Document doc;
 
250
                                readonly string testCase;
 
251
                                readonly bool debug;
 
252
 
 
253
                                public TestRunner (MonoDevelop.Ide.Gui.Document doc, string testCase, bool debug)
 
254
                                {
 
255
                                        this.doc = doc;
 
256
                                        this.testCase = testCase;
 
257
                                        this.debug = debug;
 
258
                                }
 
259
 
 
260
                                bool TimeoutHandler ()
 
261
                                {
 
262
                                        var test = NUnitService.Instance.SearchTestById (testCase);
 
263
                                        if (test != null) {
 
264
                                                RunTest (test); 
 
265
                                                timeoutHandler = 0;
 
266
                                        } else {
 
267
                                                return true;
 
268
                                        }
 
269
                                        return false;
 
270
                                }
 
271
 
 
272
 
 
273
                                internal void Run (object sender, EventArgs e)
 
274
                                {
 
275
                                        menu.Destroy ();
 
276
                                        menu = null;
 
277
                                        if (IdeApp.ProjectOperations.IsBuilding (IdeApp.ProjectOperations.CurrentSelectedSolution) || 
 
278
                                            IdeApp.ProjectOperations.IsRunning (IdeApp.ProjectOperations.CurrentSelectedSolution))
 
279
                                                return;
 
280
                                        var buildOperation = IdeApp.ProjectOperations.Build (IdeApp.ProjectOperations.CurrentSelectedSolution);
 
281
                                        buildOperation.Completed += delegate {
 
282
                                                if (!buildOperation.Success)
 
283
                                                        return;
 
284
                                                RemoveHandler ();
 
285
                                                timeoutHandler = GLib.Timeout.Add (200, TimeoutHandler);
 
286
                                        };
 
287
                                }
 
288
 
 
289
                                void RunTest (UnitTest test)
 
290
                                {
 
291
                                        NUnitService.ResetResult (test.RootTest);
 
292
                                        var debugModeSet = Runtime.ProcessService.GetDebugExecutionMode ();
 
293
                                        MonoDevelop.Core.Execution.IExecutionHandler ctx = null;
 
294
                                        if (debug && debugModeSet != null) {
 
295
                                                foreach (var executionMode in debugModeSet.ExecutionModes) {
 
296
                                                        if (test.CanRun (executionMode.ExecutionHandler)) {
 
297
                                                                ctx = executionMode.ExecutionHandler;
 
298
                                                                break;
 
299
                                                        }
 
300
                                                }
 
301
                                        }
 
302
                                        NUnitService.Instance.RunTest (test, ctx).Completed += delegate {
 
303
                                                Application.Invoke (delegate {
 
304
                                                        doc.Editor.Parent.QueueDraw ();
 
305
                                                });
 
306
                                        };
 
307
                                }
 
308
 
 
309
 
 
310
                        }
 
311
 
 
312
                        bool isFailed;
 
313
                        string failMessage;
 
314
                        public override void DrawForeground (TextEditor editor, Cairo.Context cr, MarginDrawMetrics metrics)
 
315
                        {
 
316
                                cr.Arc (metrics.X + metrics.Width / 2 + 2, metrics.Y + metrics.Height / 2, 7 * editor.Options.Zoom, 0, Math.PI * 2);
 
317
                                isFailed = false;
 
318
                                var test = NUnitService.Instance.SearchTestById (unitTest.UnitTestIdentifier);
 
319
                                bool searchCases = false;
 
320
                                if (test != null) {
 
321
                                        var result = test.GetLastResult ();
 
322
                                        if (result == null || result.IsNotRun) {
 
323
                                                cr.Color = new Cairo.Color (0.5, 0.5, 0.5);
 
324
                                                searchCases = true;
 
325
                                        } else if (result.IsSuccess) {
 
326
                                                cr.Color = new Cairo.Color (0, 1, 0, test.IsHistoricResult ? 0.2 : 1.0);
 
327
                                        } else if (result.IsFailure) {
 
328
                                                cr.Color = new Cairo.Color (1, 0, 0, test.IsHistoricResult ? 0.2 : 1.0);
 
329
                                                failMessage = result.Message;
 
330
                                                isFailed = true;
 
331
                                        } else if (result.IsInconclusive) {
 
332
                                                cr.Color = new Cairo.Color (0, 1, 1, test.IsHistoricResult ? 0.2 : 1.0);
 
333
                                        } 
 
334
                                } else {
 
335
                                        cr.Color = new Cairo.Color (0.5, 0.5, 0.5);
 
336
                                        searchCases = true;
 
337
                                }
 
338
 
 
339
                                if (searchCases) {
 
340
                                        foreach (var caseId in unitTest.TestCases) {
 
341
                                                test = NUnitService.Instance.SearchTestById (unitTest.UnitTestIdentifier + caseId);
 
342
                                                if (test != null) {
 
343
                                                        var result = test.GetLastResult ();
 
344
                                                        if (result == null || result.IsNotRun || test.IsHistoricResult) {
 
345
                                                        } else if (result.IsSuccess) {
 
346
                                                                cr.Color = new Cairo.Color (0, 1, 0);
 
347
                                                        } else if (result.IsFailure) {
 
348
                                                                cr.Color = new Cairo.Color (1, 0, 0);
 
349
                                                                failMessage = result.Message;
 
350
                                                                isFailed = true;
 
351
                                                                break;
 
352
                                                        } else if (result.IsInconclusive) {
 
353
                                                                cr.Color = new Cairo.Color (0, 1, 1);
 
354
                                                        } 
 
355
                                                }
 
356
                                        }
 
357
                                }
 
358
 
 
359
                                cr.FillPreserve ();
 
360
 
 
361
                                if (test != null) {
 
362
                                        var result = test.GetLastResult ();
 
363
                                        if (result == null || result.IsNotRun) {
 
364
                                                cr.Color = new Cairo.Color (0.2, 0.2, 0.2);
 
365
                                                cr.Stroke ();
 
366
                                        } else if (result.IsSuccess && !test.IsHistoricResult) {
 
367
                                                cr.Color = new Cairo.Color (0, 0.5, 0);
 
368
                                                cr.Stroke ();
 
369
                                        } else if (result.IsFailure && !test.IsHistoricResult) {
 
370
                                                cr.Color = new Cairo.Color (0.5, 0, 0);
 
371
                                                cr.Stroke ();
 
372
                                        } else if (result.IsInconclusive && !test.IsHistoricResult) {
 
373
                                                cr.Color = new Cairo.Color (0, 0.7, 0.7);
 
374
                                                cr.Stroke ();
 
375
                                        } 
 
376
                                }
 
377
                                cr.NewPath ();
 
378
                        }
 
379
                }
 
380
 
 
381
                class NUnitVisitor : DepthFirstAstVisitor
 
382
                {
 
383
                        readonly CSharpAstResolver resolver;
 
384
                        List<UnitTest> foundTests = new List<UnitTest> ();
 
385
 
 
386
                        public IList<UnitTest> FoundTests {
 
387
                                get {
 
388
                                        return foundTests;
 
389
                                }
 
390
                        }
 
391
 
 
392
                        public class UnitTest
 
393
                        {
 
394
                                public int LineNumber { get; set; }
 
395
                                public bool IsFixture { get; set; }
 
396
                                public string UnitTestIdentifier { get; set; }
 
397
                                public List<string> TestCases = new List<string> ();
 
398
 
 
399
                                public UnitTest (int lineNumber)
 
400
                                {
 
401
                                        this.LineNumber = lineNumber;
 
402
                                }
 
403
                        }
 
404
 
 
405
                        public NUnitVisitor (CSharpAstResolver resolver)
 
406
                        {
 
407
                                this.resolver = resolver;
 
408
                        }
 
409
 
 
410
                        string GetFullName (TypeDeclaration typeDeclaration)
 
411
                        {
 
412
                                var parts = new List<string> ();
 
413
 
 
414
                                while (true) {
 
415
                                        parts.Add (typeDeclaration.Name);
 
416
                                        if (typeDeclaration.Parent is TypeDeclaration) {
 
417
                                                typeDeclaration = (TypeDeclaration)typeDeclaration.Parent;
 
418
                                        } else {
 
419
                                                break;
 
420
                                        }
 
421
                                };
 
422
 
 
423
                                var ns = typeDeclaration.Parent as NamespaceDeclaration;
 
424
                                if (ns != null)
 
425
                                        parts.Add (ns.FullName);
 
426
                                parts.Reverse ();
 
427
                                return string.Join (".", parts);
 
428
                        }
 
429
 
 
430
                        void AppendConstant (StringBuilder sb, object constantValue)
 
431
                        {
 
432
                                if (constantValue is string)
 
433
                                        sb.Append ('"');
 
434
                                if (constantValue is char)
 
435
                                        sb.Append ('\"');
 
436
                                sb.Append (constantValue);
 
437
                                if (constantValue is string)
 
438
                                        sb.Append ('"');
 
439
                                if (constantValue is char)
 
440
                                        sb.Append ('\"');
 
441
                        }
 
442
 
 
443
                        string BuildArguments (IAttribute attr)
 
444
                        {
 
445
                                StringBuilder sb = new StringBuilder ();
 
446
                                foreach (var arg in attr.PositionalArguments) {
 
447
                                        if (sb.Length > 0)
 
448
                                                sb.Append (", ");
 
449
                                        var cr = arg as ConversionResolveResult;
 
450
                                        if (cr != null) {
 
451
                                                AppendConstant (sb, cr.Input.ConstantValue);
 
452
                                                continue;
 
453
                                        }
 
454
                                        AppendConstant (sb, arg.ConstantValue);
 
455
                                }
 
456
                                return sb.ToString ();
 
457
                        }
 
458
 
 
459
                        public override void VisitMethodDeclaration (MethodDeclaration methodDeclaration)
 
460
                        {
 
461
                                var result = resolver.Resolve (methodDeclaration) as MemberResolveResult;
 
462
                                if (result == null)
 
463
                                        return;
 
464
                                var method = result.Member as IMethod;
 
465
 
 
466
                                UnitTest test = null;
 
467
 
 
468
                                foreach (var attr in method.Attributes) {
 
469
                                        if (attr.AttributeType.ReflectionName == "NUnit.Framework.TestAttribute") {
 
470
                                                if (test == null) {
 
471
                                                        test = new UnitTest (methodDeclaration.NameToken.StartLocation.Line);
 
472
                                                        test.UnitTestIdentifier = GetFullName ((TypeDeclaration)methodDeclaration.Parent) + "." + methodDeclaration.Name;
 
473
                                                        foundTests.Add (test);
 
474
                                                }
 
475
                                        } else if (attr.AttributeType.ReflectionName == "NUnit.Framework.TestCaseAttribute") {
 
476
                                                test.TestCases.Add ("(" + BuildArguments (attr) + ")");
 
477
                                        }
 
478
                                }
 
479
                        }
 
480
 
 
481
                        public override void VisitTypeDeclaration (TypeDeclaration typeDeclaration)
 
482
                        {
 
483
                                var result = resolver.Resolve (typeDeclaration);
 
484
 
 
485
                                foreach (var attr in result.Type.GetDefinition ().Attributes) {
 
486
                                        
 
487
                                        if (attr.AttributeType.ReflectionName == "NUnit.Framework.TestFixtureAttribute") {
 
488
                                                var unitTest = new UnitTest (typeDeclaration.NameToken.StartLocation.Line);
 
489
                                                unitTest.IsFixture = true;
 
490
                                                unitTest.UnitTestIdentifier = GetFullName (typeDeclaration);
 
491
                                                foundTests.Add (unitTest);
 
492
                                        }
 
493
                                }
 
494
                                base.VisitTypeDeclaration (typeDeclaration);
 
495
                        }
 
496
 
 
497
                        public override void VisitBlockStatement (BlockStatement blockStatement)
 
498
                        {
 
499
                        }
 
500
                }
 
501
        }
 
502
}
 
503