~halega/+junk/sharpdevelop

« back to all changes in this revision

Viewing changes to src/AddIns/BackendBindings/Ruby/RubyBinding/Test/Parsing/ParseInvalidRubyCodeTestFixture.cs

  • Committer: sk
  • Date: 2011-09-10 05:17:57 UTC
  • Revision ID: halega@halega.com-20110910051757-qfouz1llya9m6boy
4.1.0.7915 Release Candidate 1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
 
2
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
 
3
 
 
4
using System;
 
5
using ICSharpCode.RubyBinding;
 
6
using ICSharpCode.SharpDevelop.Dom;
 
7
using NUnit.Framework;
 
8
using RubyBinding.Tests;
 
9
 
 
10
namespace RubyBinding.Tests.Parsing
 
11
{
 
12
        /// <summary>
 
13
        /// Tests that the rubyparser does not throw an exception
 
14
        /// when the ruby code is invalid.
 
15
        /// </summary>
 
16
        [TestFixture]
 
17
        public class ParseInvalidRubyCodeTestFixture
 
18
        {
 
19
                ICompilationUnit compilationUnit;
 
20
                
 
21
                [TestFixtureSetUp]
 
22
                public void SetUpFixture()
 
23
                {
 
24
                        string ruby = "class Class1\r\n" +
 
25
                                "    @\r\n" +
 
26
                                "end";
 
27
                        
 
28
                        DefaultProjectContent projectContent = new DefaultProjectContent();
 
29
                        RubyParser parser = new RubyParser();
 
30
                        compilationUnit = parser.Parse(projectContent, @"C:\test.rb", ruby);                    
 
31
                }
 
32
                
 
33
                [Test]
 
34
                public void CompilationUnitIsNotNull()
 
35
                {
 
36
                        Assert.IsNotNull(compilationUnit);
 
37
                }
 
38
                
 
39
                [Test]
 
40
                public void FileNameSet()
 
41
                {
 
42
                        Assert.AreEqual(@"C:\test.rb", compilationUnit.FileName);
 
43
                }
 
44
        }
 
45
}