#develop (short for SharpDevelop) is a free IDE for .NET programming languages.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

47 lines
1.3 KiB

// 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.Dom;
namespace ICSharpCode.NRefactory.VB.Tests.Dom
{
[TestFixture]
public class BlockStatementTests
{
#region C#
[Test]
public void CSharpBlockStatementTest()
{
BlockStatement blockStmt = ParseUtilCSharp.ParseStatement<BlockStatement>("{}");
}
[Test]
public void CSharpComplexBlockStatementPositionTest()
{
string code = @"{
WebClient wc = new WebClient();
wc.Test();
wc.UploadStringCompleted += delegate {
output.BeginInvoke((MethodInvoker)delegate {
output.Text += newText;
});
};
}";
BlockStatement blockStmt = ParseUtilCSharp.ParseStatement<BlockStatement>(code);
//Assert.AreEqual(1, blockStmt.StartLocation.Column); // does not work because ParseStatement inserts special code
Assert.AreEqual(1, blockStmt.StartLocation.Line);
Assert.AreEqual(2, blockStmt.EndLocation.Column);
Assert.AreEqual(9, blockStmt.EndLocation.Line);
}
#endregion
#region VB.NET
// TODO
#endregion
}
}