diff --git a/ICSharpCode.Decompiler.Tests/ICSharpCode.Decompiler.Tests.csproj b/ICSharpCode.Decompiler.Tests/ICSharpCode.Decompiler.Tests.csproj
index 358621572..86e44c3d0 100644
--- a/ICSharpCode.Decompiler.Tests/ICSharpCode.Decompiler.Tests.csproj
+++ b/ICSharpCode.Decompiler.Tests/ICSharpCode.Decompiler.Tests.csproj
@@ -66,6 +66,7 @@
+
diff --git a/ICSharpCode.Decompiler.Tests/PrettyTestRunner.cs b/ICSharpCode.Decompiler.Tests/PrettyTestRunner.cs
index 356c6aa5c..adc2eb24b 100644
--- a/ICSharpCode.Decompiler.Tests/PrettyTestRunner.cs
+++ b/ICSharpCode.Decompiler.Tests/PrettyTestRunner.cs
@@ -273,6 +273,12 @@ namespace ICSharpCode.Decompiler.Tests
RunForLibrary(cscOptions: cscOptions);
}
+ [Test]
+ public void QualifierTests([ValueSource("defaultOptions")] CSharpCompilerOptions cscOptions)
+ {
+ RunForLibrary(cscOptions: cscOptions);
+ }
+
[Test]
public void Issue1080([ValueSource(nameof(roslynOnlyOptions))] CSharpCompilerOptions cscOptions)
{
diff --git a/ICSharpCode.Decompiler.Tests/TestCases/ILPretty/Issue1047.cs b/ICSharpCode.Decompiler.Tests/TestCases/ILPretty/Issue1047.cs
index 3aa1c7c4a..f5d32e786 100644
--- a/ICSharpCode.Decompiler.Tests/TestCases/ILPretty/Issue1047.cs
+++ b/ICSharpCode.Decompiler.Tests/TestCases/ILPretty/Issue1047.cs
@@ -7,7 +7,7 @@
private void ProblemMethod()
{
IL_0000:
- while (!Issue1047.dummy) {
+ while (!dummy) {
}
return;
IL_0014:
diff --git a/ICSharpCode.Decompiler.Tests/TestCases/ILPretty/Issue982.cs b/ICSharpCode.Decompiler.Tests/TestCases/ILPretty/Issue982.cs
index 5f039b7a7..74205c661 100644
--- a/ICSharpCode.Decompiler.Tests/TestCases/ILPretty/Issue982.cs
+++ b/ICSharpCode.Decompiler.Tests/TestCases/ILPretty/Issue982.cs
@@ -8,19 +8,19 @@
public string Text {
get {
- return this.textStr;
+ return textStr;
}
set {
- this.textStr = value;
+ textStr = value;
}
}
public string this[int index] {
get {
- return this.textStr2;
+ return textStr2;
}
set {
- this.textStr2 = value;
+ textStr2 = value;
}
}
}
diff --git a/ICSharpCode.Decompiler.Tests/TestCases/Pretty/AnonymousTypes.cs b/ICSharpCode.Decompiler.Tests/TestCases/Pretty/AnonymousTypes.cs
index 0120f050f..949ef3f07 100644
--- a/ICSharpCode.Decompiler.Tests/TestCases/Pretty/AnonymousTypes.cs
+++ b/ICSharpCode.Decompiler.Tests/TestCases/Pretty/AnonymousTypes.cs
@@ -105,7 +105,7 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Pretty
#if CS70
private void AnonymousTypeOutVar()
{
- AnonymousTypes.InlineVarDecl(out var anon, new {
+ InlineVarDecl(out var anon, new {
X = 1,
Y = 2
});
diff --git a/ICSharpCode.Decompiler.Tests/TestCases/Pretty/Async.cs b/ICSharpCode.Decompiler.Tests/TestCases/Pretty/Async.cs
index 5ee72d908..bb526b284 100644
--- a/ICSharpCode.Decompiler.Tests/TestCases/Pretty/Async.cs
+++ b/ICSharpCode.Decompiler.Tests/TestCases/Pretty/Async.cs
@@ -74,7 +74,7 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Pretty
public async void TwoAwaitsWithDifferentAwaiterTypes()
{
Console.WriteLine("Before");
- if (await this.SimpleBoolTaskMethod()) {
+ if (await SimpleBoolTaskMethod()) {
await Task.Delay(TimeSpan.FromSeconds(1.0));
}
Console.WriteLine("After");
@@ -82,7 +82,7 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Pretty
public async void AwaitInLoopCondition()
{
- while (await this.SimpleBoolTaskMethod()) {
+ while (await SimpleBoolTaskMethod()) {
Console.WriteLine("Body");
}
}
diff --git a/ICSharpCode.Decompiler.Tests/TestCases/Pretty/CheckedUnchecked.cs b/ICSharpCode.Decompiler.Tests/TestCases/Pretty/CheckedUnchecked.cs
index f58fa70b4..58dc08cbb 100644
--- a/ICSharpCode.Decompiler.Tests/TestCases/Pretty/CheckedUnchecked.cs
+++ b/ICSharpCode.Decompiler.Tests/TestCases/Pretty/CheckedUnchecked.cs
@@ -63,7 +63,7 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Pretty
}
public void ObjectCreationInitializerChecked()
{
- this.TestHelp(new {
+ TestHelp(new {
x = 0,
l = 0
}, n => checked(new {
@@ -74,7 +74,7 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Pretty
public void ObjectCreationWithOneFieldChecked()
{
- this.TestHelp(new {
+ TestHelp(new {
x = 0,
l = 0
}, n => new {
@@ -85,7 +85,7 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Pretty
public void ArrayInitializerChecked()
{
- this.TestHelp(new int[2] {
+ TestHelp(new int[2] {
1,
2
}, (int[] n) => checked(new int[2] {
diff --git a/ICSharpCode.Decompiler.Tests/TestCases/Pretty/CompoundAssignmentTest.cs b/ICSharpCode.Decompiler.Tests/TestCases/Pretty/CompoundAssignmentTest.cs
index 84077863f..494132abc 100644
--- a/ICSharpCode.Decompiler.Tests/TestCases/Pretty/CompoundAssignmentTest.cs
+++ b/ICSharpCode.Decompiler.Tests/TestCases/Pretty/CompoundAssignmentTest.cs
@@ -204,46 +204,46 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Pretty
public void IntegerField(int i)
{
- Console.WriteLine(this.test1 += i);
- Console.WriteLine(this.test1);
- Console.WriteLine(this.test1 -= i);
- Console.WriteLine(this.test1);
+ Console.WriteLine(test1 += i);
+ Console.WriteLine(test1);
+ Console.WriteLine(test1 -= i);
+ Console.WriteLine(test1);
}
public void Array(int i)
{
- Console.WriteLine(this.array1[i] += i);
- Console.WriteLine(this.array1[i * 2] += i * 2);
+ Console.WriteLine(array1[i] += i);
+ Console.WriteLine(array1[i * 2] += i * 2);
}
public int ArrayUsageWithMethods()
{
- return this.GetArray()[this.GetIndex()]++;
+ return GetArray()[GetIndex()]++;
}
public void NestedField()
{
- if (this.field1.HasIndex) {
- Console.WriteLine(this.field1.Field *= 2);
- this.field1.Field++;
- Console.WriteLine(this.field1.Field++);
+ if (field1.HasIndex) {
+ Console.WriteLine(field1.Field *= 2);
+ field1.Field++;
+ Console.WriteLine(field1.Field++);
}
}
public void Enum()
{
- this.enumField |= MyEnum.Two;
- this.enumField &= ~MyEnum.Four;
- this.enumField += 2;
- this.enumField -= 3;
+ enumField |= MyEnum.Two;
+ enumField &= ~MyEnum.Four;
+ enumField += 2;
+ enumField -= 3;
}
public void ShortEnumTest()
{
- this.shortEnumField |= ShortEnum.Two;
- this.shortEnumField &= ShortEnum.Four;
- this.shortEnumField += 2;
- this.shortEnumField -= 3;
+ shortEnumField |= ShortEnum.Two;
+ shortEnumField &= ShortEnum.Four;
+ shortEnumField += 2;
+ shortEnumField -= 3;
}
public int PreIncrementInAddition(int i, int j)
@@ -303,27 +303,27 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Pretty
public int PreIncrementInstanceField()
{
- return ++this.M().Field;
+ return ++M().Field;
}
public int PostIncrementInstanceField()
{
- return this.M().Field++;
+ return M().Field++;
}
public void IncrementInstanceField()
{
- this.M().Field++;
+ M().Field++;
}
public void DoubleInstanceField()
{
- this.M().Field *= 2;
+ M().Field *= 2;
}
public int DoubleInstanceFieldAndReturn()
{
- return this.M().Field *= 2;
+ return M().Field *= 2;
}
public int PreIncrementInstanceField2(MutableClass m)
@@ -343,157 +343,157 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Pretty
public int PreIncrementInstanceFieldShort()
{
- return ++this.M().ShortField;
+ return ++M().ShortField;
}
public int PostIncrementInstanceFieldShort()
{
- return this.M().ShortField++;
+ return M().ShortField++;
}
public void IncrementInstanceFieldShort()
{
- this.M().ShortField++;
+ M().ShortField++;
}
public int PreIncrementInstanceProperty()
{
- return ++this.M().Property;
+ return ++M().Property;
}
public int PostIncrementInstanceProperty()
{
- return this.M().Property++;
+ return M().Property++;
}
public void IncrementInstanceProperty()
{
- this.M().Property++;
+ M().Property++;
}
public void DoubleInstanceProperty()
{
- this.M().Property *= 2;
+ M().Property *= 2;
}
public int DoubleInstancePropertyAndReturn()
{
- return this.M().Property *= 2;
+ return M().Property *= 2;
}
public int PreIncrementInstancePropertyByte()
{
- return ++this.M().ByteProperty;
+ return ++M().ByteProperty;
}
public int PostIncrementInstancePropertyByte()
{
- return this.M().ByteProperty++;
+ return M().ByteProperty++;
}
public void IncrementInstancePropertyByte()
{
- this.M().ByteProperty++;
+ M().ByteProperty++;
}
public void DoubleInstancePropertyByte()
{
- this.M().ByteProperty *= 2;
+ M().ByteProperty *= 2;
}
public int DoubleInstancePropertyByteAndReturn()
{
- return this.M().ByteProperty *= 2;
+ return M().ByteProperty *= 2;
}
public int PreIncrementStaticField()
{
- return ++CompoundAssignmentTest.StaticField;
+ return ++StaticField;
}
public int PostIncrementStaticField()
{
- return CompoundAssignmentTest.StaticField++;
+ return StaticField++;
}
public void IncrementStaticField()
{
- CompoundAssignmentTest.StaticField++;
+ StaticField++;
}
public void DoubleStaticField()
{
- CompoundAssignmentTest.StaticField *= 2;
+ StaticField *= 2;
}
public int DoubleStaticFieldAndReturn()
{
- return CompoundAssignmentTest.StaticField *= 2;
+ return StaticField *= 2;
}
public int PreIncrementStaticFieldShort()
{
- return ++CompoundAssignmentTest.StaticShortField;
+ return ++StaticShortField;
}
public int PostIncrementStaticFieldShort()
{
- return CompoundAssignmentTest.StaticShortField++;
+ return StaticShortField++;
}
public void IncrementStaticFieldShort()
{
- CompoundAssignmentTest.StaticShortField++;
+ StaticShortField++;
}
public void DoubleStaticFieldShort()
{
- CompoundAssignmentTest.StaticShortField *= 2;
+ StaticShortField *= 2;
}
public short DoubleStaticFieldAndReturnShort()
{
- return CompoundAssignmentTest.StaticShortField *= 2;
+ return StaticShortField *= 2;
}
public int PreIncrementStaticProperty()
{
- return ++CompoundAssignmentTest.StaticProperty;
+ return ++StaticProperty;
}
public int PostIncrementStaticProperty()
{
- return CompoundAssignmentTest.StaticProperty++;
+ return StaticProperty++;
}
public void IncrementStaticProperty()
{
- CompoundAssignmentTest.StaticProperty++;
+ StaticProperty++;
}
public void DoubleStaticProperty()
{
- CompoundAssignmentTest.StaticProperty *= 2;
+ StaticProperty *= 2;
}
public int DoubleStaticPropertyAndReturn()
{
- return CompoundAssignmentTest.StaticProperty *= 2;
+ return StaticProperty *= 2;
}
public ShortEnum PreIncrementStaticPropertyShort()
{
- return ++CompoundAssignmentTest.StaticShortProperty;
+ return ++StaticShortProperty;
}
public ShortEnum PostIncrementStaticPropertyShort()
{
- return CompoundAssignmentTest.StaticShortProperty++;
+ return StaticShortProperty++;
}
public void IncrementStaticPropertyShort()
{
- CompoundAssignmentTest.StaticShortProperty++;
+ StaticShortProperty++;
}
private static Item GetItem(object obj)
@@ -503,7 +503,7 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Pretty
private static void Issue882()
{
- Item item = CompoundAssignmentTest.GetItem(null);
+ Item item = GetItem(null);
item.Self = item;
}
@@ -512,12 +512,12 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Pretty
// cannot decompile to: "a %= b;", because the % operator does not apply to enums
a = (MyEnum)((int)a % (int)b);
// same with enum field:
- this.enumField = (MyEnum)((int)this.enumField % (int)b);
+ enumField = (MyEnum)((int)enumField % (int)b);
}
private void Issue588(ushort val)
{
- this.ushortDict.Add(this.ushortField++, val);
+ ushortDict.Add(ushortField++, val);
}
private void Issue1007(TimeSpan[] items, int startIndex, TimeSpan item)
diff --git a/ICSharpCode.Decompiler.Tests/TestCases/Pretty/DelegateConstruction.cs b/ICSharpCode.Decompiler.Tests/TestCases/Pretty/DelegateConstruction.cs
index e39e9f5f8..7d5e48a65 100644
--- a/ICSharpCode.Decompiler.Tests/TestCases/Pretty/DelegateConstruction.cs
+++ b/ICSharpCode.Decompiler.Tests/TestCases/Pretty/DelegateConstruction.cs
@@ -35,14 +35,14 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Pretty
public Action CaptureOfThis()
{
return delegate {
- this.CaptureOfThis();
+ CaptureOfThis();
};
}
public Action CaptureOfThisAndParameter(int a)
{
return delegate {
- this.CaptureOfThisAndParameter(a);
+ CaptureOfThisAndParameter(a);
};
}
@@ -51,7 +51,7 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Pretty
foreach (int item in Enumerable.Empty()) {
if (item > 0) {
return delegate {
- this.CaptureOfThisAndParameter(item + a);
+ CaptureOfThisAndParameter(item + a);
};
}
}
@@ -64,7 +64,7 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Pretty
int copyOfItem = item;
if (item > 0) {
return delegate {
- this.CaptureOfThisAndParameter(item + a + copyOfItem);
+ CaptureOfThisAndParameter(item + a + copyOfItem);
};
}
}
@@ -74,7 +74,7 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Pretty
public void LambdaInForLoop()
{
for (int i = 0; i < 100000; i++) {
- this.Bar(() => this.Foo());
+ Bar(() => Foo());
}
}
@@ -95,34 +95,34 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Pretty
public void Bug951(int amount)
{
- this.DoAction(delegate {
+ DoAction(delegate {
if (amount < 0) {
amount = 0;
}
- this.DoAction(delegate {
- this.NoOp(amount);
+ DoAction(delegate {
+ NoOp(amount);
});
});
}
public void Bug951b()
{
- int amount = this.Foo();
- this.DoAction(delegate {
+ int amount = Foo();
+ DoAction(delegate {
if (amount < 0) {
amount = 0;
}
- this.DoAction(delegate {
- this.NoOp(amount);
+ DoAction(delegate {
+ NoOp(amount);
});
});
}
public void Bug951c(SomeData data)
{
- this.DoAction(delegate {
- this.DoAction(delegate {
- this.DoSomething(data.Value);
+ DoAction(delegate {
+ DoAction(delegate {
+ DoSomething(data.Value);
});
});
}
@@ -152,7 +152,7 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Pretty
public static Action ExtensionMethodUnbound()
{
- return DelegateConstruction.Test;
+ return Test;
}
public static Action ExtensionMethodBound()
@@ -167,7 +167,7 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Pretty
public static object StaticMethod()
{
- return new Func(DelegateConstruction.ExtensionMethodBound);
+ return new Func(ExtensionMethodBound);
}
public static object InstanceMethod()
diff --git a/ICSharpCode.Decompiler.Tests/TestCases/Pretty/ExceptionHandling.cs b/ICSharpCode.Decompiler.Tests/TestCases/Pretty/ExceptionHandling.cs
index 859cd59aa..e73422857 100644
--- a/ICSharpCode.Decompiler.Tests/TestCases/Pretty/ExceptionHandling.cs
+++ b/ICSharpCode.Decompiler.Tests/TestCases/Pretty/ExceptionHandling.cs
@@ -34,8 +34,8 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Pretty
public bool ConditionalReturnInThrow()
{
try {
- if (this.B(0)) {
- return this.B(1);
+ if (B(0)) {
+ return B(1);
}
} catch {
}
@@ -46,7 +46,7 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Pretty
{
try {
Console.WriteLine("Try");
- return this.B(new Random().Next());
+ return B(new Random().Next());
} catch (Exception) {
Console.WriteLine("CatchException");
}
@@ -57,7 +57,7 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Pretty
{
try {
Console.WriteLine("Try");
- return this.B(new Random().Next());
+ return B(new Random().Next());
} catch (Exception ex) {
Console.WriteLine("CatchException ex: " + ex.ToString());
}
@@ -69,7 +69,7 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Pretty
{
try {
Console.WriteLine("Try");
- return this.B(new Random().Next());
+ return B(new Random().Next());
} catch (Exception ex) when (ex.Message.Contains("test")) {
Console.WriteLine("CatchException ex: " + ex.ToString());
}
@@ -80,7 +80,7 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Pretty
{
try {
Console.WriteLine("Try");
- return this.B(new Random().Next());
+ return B(new Random().Next());
} catch (Exception ex) when (ex is ArgumentException || ex is IOException) {
Console.WriteLine("CatchException ex: " + ex.ToString());
}
@@ -91,7 +91,7 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Pretty
{
try {
Console.WriteLine("Try");
- return await this.T();
+ return await T();
} catch (Exception ex) when (ex is ArgumentException || ex is IOException) {
Console.WriteLine("CatchException ex: " + ex.ToString());
}
diff --git a/ICSharpCode.Decompiler.Tests/TestCases/Pretty/ExpressionTrees.cs b/ICSharpCode.Decompiler.Tests/TestCases/Pretty/ExpressionTrees.cs
index 96b586056..db40b39b1 100644
--- a/ICSharpCode.Decompiler.Tests/TestCases/Pretty/ExpressionTrees.cs
+++ b/ICSharpCode.Decompiler.Tests/TestCases/Pretty/ExpressionTrees.cs
@@ -77,28 +77,28 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Pretty
public void Parameter(bool a)
{
- ExpressionTrees.ToCode(ExpressionTrees.X(), () => a);
+ ToCode(X(), () => a);
}
public void LocalVariable()
{
bool a = true;
- ExpressionTrees.ToCode(ExpressionTrees.X(), () => a);
+ ToCode(X(), () => a);
}
public void LambdaParameter()
{
- ExpressionTrees.ToCode(ExpressionTrees.X(), (bool a) => a);
+ ToCode(X(), (bool a) => a);
}
public void AddOperator(int x)
{
- ExpressionTrees.ToCode(ExpressionTrees.X(), () => 1 + x + 2);
+ ToCode(X(), () => 1 + x + 2);
}
public void AnonymousClasses()
{
- ExpressionTrees.ToCode(ExpressionTrees.X(), () => new {
+ ToCode(X(), () => new {
X = 3,
A = "a"
});
@@ -106,7 +106,7 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Pretty
public void ArrayIndex()
{
- ExpressionTrees.ToCode(ExpressionTrees.X(), () => (new int[3] {
+ ToCode(X(), () => (new int[3] {
3,
4,
5
@@ -115,7 +115,7 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Pretty
public void ArrayLengthAndDoubles()
{
- ExpressionTrees.ToCode(ExpressionTrees.X(), () => new double[3] {
+ ToCode(X(), () => new double[3] {
1.0,
2.01,
3.5
@@ -127,38 +127,38 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Pretty
public void AsOperator()
{
- ExpressionTrees.ToCode(ExpressionTrees.X(), () => new object() as string);
+ ToCode(X(), () => new object() as string);
}
public void ComplexGenericName()
{
- ExpressionTrees.ToCode(ExpressionTrees.X(), () => ((Func)((int x) => x > 0))(0));
+ ToCode(X(), () => ((Func)((int x) => x > 0))(0));
}
public void DefaultValue()
{
- ExpressionTrees.ToCode(ExpressionTrees.X(), () => new TimeSpan(1, 2, 3) == default(TimeSpan));
+ ToCode(X(), () => new TimeSpan(1, 2, 3) == default(TimeSpan));
}
public void EnumConstant()
{
- ExpressionTrees.ToCode(ExpressionTrees.X(), () => new object().Equals(MidpointRounding.ToEven));
+ ToCode(X(), () => new object().Equals(MidpointRounding.ToEven));
}
public void IndexerAccess()
{
Dictionary dict = Enumerable.Range(1, 20).ToDictionary((int n) => n.ToString());
- ExpressionTrees.ToCode(ExpressionTrees.X(), () => dict["3"] == 3);
+ ToCode(X(), () => dict["3"] == 3);
}
public void IsOperator()
{
- ExpressionTrees.ToCode(ExpressionTrees.X(), () => new object() is string);
+ ToCode(X(), () => new object() is string);
}
public void ListInitializer()
{
- ExpressionTrees.ToCode(ExpressionTrees.X(), () => new Dictionary {
+ ToCode(X(), () => new Dictionary {
{
1,
1
@@ -176,7 +176,7 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Pretty
public void ListInitializer2()
{
- ExpressionTrees.ToCode(ExpressionTrees.X(), () => new List(50) {
+ ToCode(X(), () => new List(50) {
1,
2,
3
@@ -185,7 +185,7 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Pretty
public void ListInitializer3()
{
- ExpressionTrees.ToCode(ExpressionTrees.X(), () => new List {
+ ToCode(X(), () => new List {
1,
2,
3
@@ -194,51 +194,51 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Pretty
public void LiteralCharAndProperty()
{
- ExpressionTrees.ToCode(ExpressionTrees.X(), () => new string(' ', 3).Length == 1);
+ ToCode(X(), () => new string(' ', 3).Length == 1);
}
public void CharNoCast()
{
- ExpressionTrees.ToCode(ExpressionTrees.X(), () => "abc"[1] == 'b');
+ ToCode(X(), () => "abc"[1] == 'b');
}
public void StringsImplicitCast()
{
int i = 1;
string x = "X";
- ExpressionTrees.ToCode(ExpressionTrees.X(), () => ((("a\n\\b" ?? x) + x).Length == 2) ? false : (true && (1m + (decimal)(-i) > 0m || false)));
+ ToCode(X(), () => ((("a\n\\b" ?? x) + x).Length == 2) ? false : (true && (1m + (decimal)(-i) > 0m || false)));
}
public void NotImplicitCast()
{
byte z = 42;
- ExpressionTrees.ToCode(ExpressionTrees.X(), () => ~z == 0);
+ ToCode(X(), () => ~z == 0);
}
public void MembersBuiltin()
{
- ExpressionTrees.ToCode(ExpressionTrees.X(), () => 1.23m.ToString());
- ExpressionTrees.ToCode(ExpressionTrees.X(), () => ((Enum)(object)AttributeTargets.All).HasFlag((Enum)AttributeTargets.Assembly));
- ExpressionTrees.ToCode(ExpressionTrees.X(), () => "abc".Length == 3);
- ExpressionTrees.ToCode(ExpressionTrees.X(), () => 'a'.CompareTo('b') < 0);
+ ToCode(X(), () => 1.23m.ToString());
+ ToCode(X(), () => ((Enum)(object)AttributeTargets.All).HasFlag((Enum)AttributeTargets.Assembly));
+ ToCode(X(), () => "abc".Length == 3);
+ ToCode(X(), () => 'a'.CompareTo('b') < 0);
}
public void MembersDefault()
{
- ExpressionTrees.ToCode(ExpressionTrees.X(), () => default(DateTime).Ticks == 0);
- ExpressionTrees.ToCode(ExpressionTrees.X(), () => ((Array)null).Length == 0);
- ExpressionTrees.ToCode(ExpressionTrees.X(), () => ((Type)null).IsLayoutSequential);
- ExpressionTrees.ToCode(ExpressionTrees.X(), () => ((List)null).Count);
- ExpressionTrees.ToCode(ExpressionTrees.X(), () => ((Array)null).Clone() == null);
- ExpressionTrees.ToCode(ExpressionTrees.X(), () => ((Type)null).IsInstanceOfType(new object()));
- ExpressionTrees.ToCode(ExpressionTrees.X(), () => ((List)null).AsReadOnly());
+ ToCode(X(), () => default(DateTime).Ticks == 0);
+ ToCode(X(), () => ((Array)null).Length == 0);
+ ToCode(X(), () => ((Type)null).IsLayoutSequential);
+ ToCode(X(), () => ((List)null).Count);
+ ToCode(X(), () => ((Array)null).Clone() == null);
+ ToCode(X(), () => ((Type)null).IsInstanceOfType(new object()));
+ ToCode(X(), () => ((List)null).AsReadOnly());
}
public void DoAssert()
{
- ExpressionTrees.ToCode(ExpressionTrees.X(), () => this.field != this.C());
- ExpressionTrees.ToCode(ExpressionTrees.X(), () => !object.ReferenceEquals(this, new ExpressionTrees()));
- ExpressionTrees.ToCode(ExpressionTrees.X(), () => this.MyEquals(this) && !this.MyEquals(null));
+ ToCode(X(), () => field != C());
+ ToCode(X(), () => !object.ReferenceEquals(this, new ExpressionTrees()));
+ ToCode(X(), () => MyEquals(this) && !MyEquals(null));
}
private int C()
@@ -253,7 +253,7 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Pretty
public void MethodGroupAsExtensionMethod()
{
- ExpressionTrees.ToCode(ExpressionTrees.X(), (Expression>>)(() => ((IEnumerable)new int[4] {
+ ToCode(X(), (Expression>>)(() => ((IEnumerable)new int[4] {
2000,
2004,
2008,
@@ -263,7 +263,7 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Pretty
public void MethodGroupConstant()
{
- ExpressionTrees.ToCode(ExpressionTrees.X(), () => Array.TrueForAll(new int[4] {
+ ToCode(X(), () => Array.TrueForAll(new int[4] {
2000,
2004,
2008,
@@ -271,7 +271,7 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Pretty
}, DateTime.IsLeapYear));
HashSet set = new HashSet();
- ExpressionTrees.ToCode(ExpressionTrees.X(), () => new int[4] {
+ ToCode(X(), () => new int[4] {
2000,
2004,
2008,
@@ -279,32 +279,32 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Pretty
}.All(set.Add));
Func, bool> sink = (Func