|
|
|
@ -1,18 +1,16 @@
@@ -1,18 +1,16 @@
|
|
|
|
|
|
|
|
|
|
using System; |
|
|
|
|
using System.IO; |
|
|
|
|
using System.Linq; |
|
|
|
|
using System.Threading; |
|
|
|
|
|
|
|
|
|
using ICSharpCode.AvalonEdit.Document; |
|
|
|
|
using ICSharpCode.Core; |
|
|
|
|
using ICSharpCode.NRefactory.TypeSystem; |
|
|
|
|
using ICSharpCode.SharpDevelop; |
|
|
|
|
using ICSharpCode.SharpDevelop.Dom; |
|
|
|
|
using ICSharpCode.SharpDevelop.Editor; |
|
|
|
|
using ICSharpCode.SharpDevelop.Parser; |
|
|
|
|
using ICSharpCode.SharpDevelop.Project; |
|
|
|
|
using ICSharpCode.TypeScriptBinding; |
|
|
|
|
using ICSharpCode.TypeScriptBinding.Hosting; |
|
|
|
|
using NUnit.Framework; |
|
|
|
|
using Rhino.Mocks; |
|
|
|
|
|
|
|
|
|
namespace TypeScriptBinding.Tests.Parsing |
|
|
|
@ -22,6 +20,18 @@ namespace TypeScriptBinding.Tests.Parsing
@@ -22,6 +20,18 @@ namespace TypeScriptBinding.Tests.Parsing
|
|
|
|
|
public ParseInformation ParseInfo { get; private set; } |
|
|
|
|
public IProject Project { get; private set; } |
|
|
|
|
|
|
|
|
|
DefaultJavaScriptContext javaScriptContext; |
|
|
|
|
|
|
|
|
|
[SetUp] |
|
|
|
|
public void Init() |
|
|
|
|
{ |
|
|
|
|
try { |
|
|
|
|
javaScriptContext = new DefaultJavaScriptContext(); |
|
|
|
|
} catch (FileNotFoundException ex) { |
|
|
|
|
Assert.Inconclusive("Missing Visual C++ 2010 runtime. " + ex.Message); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public void Parse(string text, string fileName = @"d:\projects\MyProject\test.ts") |
|
|
|
|
{ |
|
|
|
|
Project = MockRepository.GenerateStub<IProject>(); |
|
|
|
@ -32,7 +42,7 @@ namespace TypeScriptBinding.Tests.Parsing
@@ -32,7 +42,7 @@ namespace TypeScriptBinding.Tests.Parsing
|
|
|
|
|
ITypeScriptContextFactory contextFactory = MockRepository.GenerateStub<ITypeScriptContextFactory>(); |
|
|
|
|
contextFactory |
|
|
|
|
.Stub(f => f.CreateContext()) |
|
|
|
|
.Return(new TypeScriptContext(new DefaultJavaScriptContext(), scriptLoader, logger)); |
|
|
|
|
.Return(new TypeScriptContext(javaScriptContext, scriptLoader, logger)); |
|
|
|
|
|
|
|
|
|
var parser = new TypeScriptParser(contextFactory); |
|
|
|
|
ParseInfo = parser.Parse(new FileName(fileName), fileContent, null, new TypeScriptFile[0]); |
|
|
|
|