using System; using Upsilon.Evaluator; using Xunit; namespace UpsilonTests.StandardLibraryTests { public class BasicFunctionsTests : TestClass { public BasicFunctionsTests(StaticScriptFixture fix) : base(fix) { } [Fact] public void AssertTest() { new Script("assert(true)", BoundScope, StaticScope).Evaluate(); Assert.Throws(() => new Script("assert(false)", BoundScope, StaticScope).Evaluate()); } [Fact] public void Error() { var e = Assert.Throws(() => new Script(@"error(""test_error"")", BoundScope, StaticScope).Evaluate()); Assert.Equal("test_error", e.Message); } } }