Upsilon/UpsilonTests/TestClass.cs

45 lines
1.2 KiB
C#
Raw Normal View History

2018-11-26 15:55:10 +00:00
using Upsilon;
2018-11-23 11:55:28 +00:00
using Upsilon.Binder;
using Upsilon.Evaluator;
using Xunit;
namespace UpsilonTests
{
[Collection("collection")]
public abstract class TestClass
{
2018-11-23 12:34:46 +00:00
protected EvaluationScope StaticScope { get; }
protected BoundScope BoundScope { get; }
2018-11-26 15:55:10 +00:00
protected ScriptOptions Options { get; }
2018-11-23 11:55:28 +00:00
2018-11-23 12:34:46 +00:00
protected TestClass(StaticScriptFixture fix)
2018-11-23 11:55:28 +00:00
{
StaticScope = fix.StaticScope;
BoundScope = fix.BoundScope;
2018-11-26 15:55:10 +00:00
Options = new ScriptOptions()
{
OverrideStaticScope = StaticScope,
OverrideStaticBoundScope = BoundScope,
};
2018-11-23 11:55:28 +00:00
}
}
[CollectionDefinition("collection")]
public class StaticScriptContext : ICollectionFixture<StaticScriptFixture>
{
}
public class StaticScriptFixture
{
public EvaluationScope StaticScope { get; }
public BoundScope BoundScope { get; }
public StaticScriptFixture()
{
2018-11-23 12:28:11 +00:00
var (evaluationScope, boundScope) = Upsilon.StandardLibraries.StaticScope.CreateStandardLibrary();
2018-11-23 11:55:28 +00:00
StaticScope = evaluationScope;
BoundScope = boundScope;
}
}
}