1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74
|
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
using System;
using System.IO;
using NUnit.Framework;
using ICSharpCode.NRefactory.VB.Parser;
using ICSharpCode.NRefactory.VB.Ast;
namespace ICSharpCode.NRefactory.VB.Tests.Ast
{
[TestFixture]
public class AttributeSectionTests
{
// [Test]
// public void AttributeOnStructure()
// {
// string program = @"
//<StructLayout( LayoutKind.Explicit )> _
//Public Structure MyUnion
//
// <FieldOffset( 0 )> Public i As Integer
// < FieldOffset( 0 )> Public d As Double
//
//End Structure 'MyUnion
//";
// TypeDeclaration decl = ParseUtil.ParseGlobal<TypeDeclaration>(program);
// Assert.AreEqual("StructLayout", decl.Attributes[0].Attributes[0].Type);
// }
//
// [Test]
// public void AttributeOnModule()
// {
// string program = @"
//<HideModule> _
//Public Module MyExtra
//
// Public i As Integer
// Public d As Double
//
//End Module
//";
// TypeDeclaration decl = ParseUtil.ParseGlobal<TypeDeclaration>(program);
// Assert.AreEqual("HideModule", decl.Attributes[0].Attributes[0].Type);
// }
//
// [Test]
// public void GlobalAttribute()
// {
// string program = @"<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
//Public Class Form1
//
//End Class";
// TypeDeclaration decl = ParseUtil.ParseGlobal<TypeDeclaration>(program);
// Assert.AreEqual("Microsoft.VisualBasic.CompilerServices.DesignerGenerated", decl.Attributes[0].Attributes[0].Type);
// }
//
// [Test]
// public void AssemblyAttribute()
// {
// string program = @"<assembly: System.Attribute()>";
// AttributeSection decl = ParseUtil.ParseGlobal<AttributeSection>(program);
// Assert.AreEqual(new Location(1, 1), decl.StartLocation);
// Assert.AreEqual("assembly", decl.AttributeTarget);
// }
//
// [Test]
// public void ModuleAttributeTargetEscaped()
// {
// // check that this doesn't crash the parser:
// ParseUtil.ParseGlobal<AttributeSection>("<[Module]: SuppressMessageAttribute>", true);
// }
}
}
|