Skip to content

Commit

Permalink
Added some indenting unit tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
Mike Krüger committed Feb 11, 2014
1 parent 412b324 commit 4730eca
Showing 1 changed file with 92 additions and 0 deletions.
92 changes: 92 additions & 0 deletions ICSharpCode.NRefactory.Tests/IndentationTests/BlockTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1081,5 +1081,97 @@ public static void Main (string[] args)
Assert.AreEqual("\t\t\t", indent.NextLineIndent);
}

[Ignore("Fixme")]
[Test]
public void TestPreprocessorIndenting_Case1()
{
var policy = FormattingOptionsFactory.CreateMono();
policy.StatementBraceStyle = BraceStyle.NextLineShifted;
var indent = Helper.CreateEngine(@"
using System;
class X
{
static void Foo (int arg)
{
#if !DEBUG
if (arg > 0) {
$#else
if (arg < 0) {
#endif
}
}
public static void Main ()
{
}
}", policy);
Assert.AreEqual("\t\t", indent.ThisLineIndent);
Assert.AreEqual("\t\t", indent.NextLineIndent);
}

[Ignore("Fixme")]
[Test]
public void TestPreprocessorIndenting_Case2()
{
var policy = FormattingOptionsFactory.CreateMono();
policy.StatementBraceStyle = BraceStyle.NextLineShifted;
var indent = Helper.CreateEngine(@"
using System;
class X
{
static void Foo (int arg)
{
#if !DEBUG
if (arg > 0) {
#else
$if (arg < 0) {
#endif
}
}
public static void Main ()
{
}
}", policy);
Assert.AreEqual("\t\t", indent.ThisLineIndent);
Assert.AreEqual("\t\t", indent.NextLineIndent);
}

[Test]
public void TestPreprocessorIndenting_Case3()
{
var policy = FormattingOptionsFactory.CreateMono();
policy.StatementBraceStyle = BraceStyle.NextLineShifted;
var indent = Helper.CreateEngine(@"
using System;
class X
{
static void Foo (int arg)
{
#if !DEBUG
if (arg > 0) {
#else
if (arg < 0) {
#endif
$
}
}
public static void Main ()
{
}
}", policy);
Assert.AreEqual("\t\t\t", indent.ThisLineIndent);
Assert.AreEqual("\t\t\t", indent.NextLineIndent);
}




}
}

0 comments on commit 4730eca

Please sign in to comment.