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 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113
|
// 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 ICSharpCode.NRefactory.VB.Parser;
using ICSharpCode.NRefactory.VB.Ast;
using NUnit.Framework;
namespace ICSharpCode.NRefactory.VB.Tests.Ast
{
[TestFixture]
public class OptionStatementTests
{
[Test]
public void InvalidOptionSyntax()
{
string program = "Option\n";
ParseUtil.ParseGlobal<OptionStatement>(program, true);
}
[Test]
public void StrictOption()
{
string program = "Option Strict On\n";
var node = new OptionStatement {
OptionType = OptionType.Strict,
OptionValue = OptionValue.On
};
ParseUtil.AssertGlobal(program, node);
}
[Test]
public void ExplicitOption()
{
string program = "Option Explicit Off\n";
var node = new OptionStatement {
OptionType = OptionType.Explicit,
OptionValue = OptionValue.Off
};
ParseUtil.AssertGlobal(program, node);
}
[Test]
public void CompareBinaryOption()
{
string program = "Option Compare Binary\n";
var node = new OptionStatement {
OptionType = OptionType.Compare,
OptionValue = OptionValue.Binary
};
ParseUtil.AssertGlobal(program, node);
}
[Test]
public void CompareTextOption()
{
string program = "Option Compare Text\n";
var node = new OptionStatement {
OptionType = OptionType.Compare,
OptionValue = OptionValue.Text
};
ParseUtil.AssertGlobal(program, node);
}
[Test]
public void InferOnOption()
{
string program = "Option Infer On\n";
var node = new OptionStatement {
OptionType = OptionType.Infer,
OptionValue = OptionValue.On
};
ParseUtil.AssertGlobal(program, node);
}
[Test]
public void InferOffOption()
{
string program = "Option Infer Off\n";
var node = new OptionStatement {
OptionType = OptionType.Infer,
OptionValue = OptionValue.Off
};
ParseUtil.AssertGlobal(program, node);
}
[Test]
public void InferOption()
{
string program = "Option Infer\n";
var node = new OptionStatement {
OptionType = OptionType.Infer,
OptionValue = OptionValue.On
};
ParseUtil.AssertGlobal(program, node);
}
}
}
|