Skip to content

Commit 3fc9b77

Browse files
author
Chaowlert
committed
support vs for mac
1 parent 4a5772a commit 3fc9b77

File tree

13 files changed

+61
-241
lines changed

13 files changed

+61
-241
lines changed

ConsoleApp1/App.config

Lines changed: 0 additions & 6 deletions
This file was deleted.

ConsoleApp1/ConsoleApp1.csproj

Lines changed: 0 additions & 60 deletions
This file was deleted.

ConsoleApp1/Properties/AssemblyInfo.cs

Lines changed: 0 additions & 36 deletions
This file was deleted.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<OutputType>Exe</OutputType>
5+
<TargetFramework>netcoreapp2.0</TargetFramework>
6+
</PropertyGroup>
7+
8+
<ItemGroup>
9+
<ProjectReference Include="..\ExpressionDebugger\ExpressionDebugger.csproj" />
10+
</ItemGroup>
11+
<ItemGroup>
12+
<Compile Remove="untitled.cs" />
13+
</ItemGroup>
14+
</Project>

ConsoleApp1/Program.cs renamed to ExpressionDebugger.Console/Program.cs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,16 @@
22
using System;
33
using System.Linq.Expressions;
44

5-
namespace ConsoleApp1
6-
{
7-
class Program
8-
{
9-
static void Main(string[] args)
10-
{
5+
namespace ExpressionDebugger.Console {
6+
class Program {
7+
static void Main(string[] args) {
118
var p1 = Expression.Parameter(typeof(int));
129
var p2 = Expression.Parameter(typeof(int));
1310
var body = Expression.Add(p1, p2);
1411
var lambda = Expression.Lambda<Func<int, int, int>>(body, p1, p2);
1512
var fun = lambda.CompileWithDebugInfo();
1613
var result = fun(1, 2);
17-
Console.WriteLine(3);
14+
System.Console.WriteLine(3);
1815
}
1916
}
2017
}

ExpressionDebugger.Test/ExpressionDebugger.Test.csproj

Lines changed: 0 additions & 74 deletions
This file was deleted.

ExpressionDebugger.Test/Properties/AssemblyInfo.cs

Lines changed: 0 additions & 20 deletions
This file was deleted.

ExpressionDebugger.Test/packages.config

Lines changed: 0 additions & 5 deletions
This file was deleted.

ExpressionDebugger.Test/DebugInfoInjectorTest.cs renamed to ExpressionDebugger.Tests/DebugInfoInjectorTest.cs

Lines changed: 12 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,11 @@
66
using Microsoft.VisualStudio.TestTools.UnitTesting;
77
using Microsoft.CSharp.RuntimeBinder;
88

9-
namespace ExpressionDebugger.Test
10-
{
9+
namespace ExpressionDebugger.Test {
1110
[TestClass]
12-
public class DebugInfoInjectorTest
13-
{
11+
public class DebugInfoInjectorTest {
1412
[TestMethod]
15-
public void TestBinary()
16-
{
13+
public void TestBinary() {
1714
Expression<Func<int, int, int>> fn = (a, b) => a + b;
1815
var str = fn.ToScript();
1916
Assert.AreEqual(
@@ -25,8 +22,7 @@ public void TestBinary()
2522
}
2623

2724
[TestMethod]
28-
public void TestBinary_ArrayIndex()
29-
{
25+
public void TestBinary_ArrayIndex() {
3026
Expression<Func<int[], int>> fn = a => a[0];
3127
var str = fn.ToScript();
3228
Assert.AreEqual(
@@ -38,8 +34,7 @@ public void TestBinary_ArrayIndex()
3834
}
3935

4036
[TestMethod]
41-
public void TestBlock()
42-
{
37+
public void TestBlock() {
4338
var p1 = Expression.Variable(typeof(int));
4439
var block = Expression.Block(new[] { p1 }, Expression.Add(p1, p1));
4540
var str = block.ToScript();
@@ -50,8 +45,7 @@ public void TestBlock()
5045
}
5146

5247
[TestMethod]
53-
public void Test_Conditional()
54-
{
48+
public void Test_Conditional() {
5549
Expression<Func<int, int>> fn = a => a < 0 ? a - 1 : a + 1;
5650
var str = fn.ToScript();
5751
Assert.AreEqual(
@@ -63,8 +57,7 @@ public void Test_Conditional()
6357
}
6458

6559
[TestMethod]
66-
public void TestConditional_Block()
67-
{
60+
public void TestConditional_Block() {
6861
var exp = Expression.Condition(
6962
Expression.Equal(Expression.Constant(1), Expression.Constant(2)),
7063
Expression.Constant(4),
@@ -84,8 +77,7 @@ public void TestConditional_Block()
8477
}
8578

8679
[TestMethod]
87-
public void TestConditional_Block_Chain()
88-
{
80+
public void TestConditional_Block_Chain() {
8981
var exp = Expression.Condition(
9082
Expression.Equal(Expression.Constant(1), Expression.Constant(2)),
9183
Expression.Constant(4),
@@ -113,8 +105,7 @@ public void TestConditional_Block_Chain()
113105
}
114106

115107
[TestMethod]
116-
public void TestConstant()
117-
{
108+
public void TestConstant() {
118109
Expression<Func<string, char>> fn = s => s == "x" || s == null || s.IsNormalized() == false || s.GetType() == typeof(string) ? 'x' : s[0];
119110
var str = fn.ToScript();
120111
Assert.AreEqual(
@@ -126,14 +117,14 @@ public void TestConstant()
126117
}
127118

128119
[TestMethod]
129-
public void TestConstant_DateTime()
130-
{
120+
public void TestConstant_DateTime() {
131121
var now = DateTime.Now;
132122
var expr = Expression.Constant(now);
133123
var script = expr.ToScript();
134124
Assert.AreEqual($"valueof(DateTime, \"{now}\")", script);
135125
}
136126

127+
#if !NETCOREAPP
137128
[TestMethod]
138129
public void TestDynamic()
139130
{
@@ -200,6 +191,7 @@ public void TestDynamic()
200191
p1 + 3;"
201192
, str);
202193
}
194+
#endif
203195

204196
[TestMethod]
205197
public void TestDefault()
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<TargetFramework>netcoreapp2.0</TargetFramework>
5+
6+
<IsPackable>false</IsPackable>
7+
</PropertyGroup>
8+
9+
<ItemGroup>
10+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.3.0-preview-20170628-02" />
11+
<PackageReference Include="MSTest.TestAdapter" Version="1.1.18" />
12+
<PackageReference Include="MSTest.TestFramework" Version="1.1.18" />
13+
</ItemGroup>
14+
15+
<ItemGroup>
16+
<ProjectReference Include="..\ExpressionDebugger\ExpressionDebugger.csproj" />
17+
</ItemGroup>
18+
</Project>

0 commit comments

Comments
 (0)