public void Can_Get_Exception_Result() { var compiler = new TypeScriptWriter(); var engine = compiler.GetEngine(); var test = @"functio greeter(person: stringz) { return ""Hello, "" +=-+ person; var user = ""Jane User""; document.body.innerHTML = greeter(user);"; Assert.Throws <TypeScriptCompilationException>(() => compiler.CompileTypeScript(engine, test)); }
public void Can_Get_Successfull_Result() { var compiler = new TypeScriptWriter(); var engine = compiler.GetEngine(); var test = @"function greeter(person: string) { return ""Hello, "" + person; } var user = ""Jane User""; document.body.innerHTML = greeter(user);"; var result = compiler.CompileTypeScript(engine, test); Assert.IsFalse(TypeScriptCompilationErrorParser.HasErrors(result)); }