Upsilon/UpsilonTests/TestClass.cs

38 lines
960 B
C#

using Upsilon.Binder;
using Upsilon.Evaluator;
using Xunit;
namespace UpsilonTests
{
[Collection("collection")]
public abstract class TestClass
{
protected EvaluationScope StaticScope { get; }
protected BoundScope BoundScope { get; }
protected TestClass(StaticScriptFixture fix)
{
StaticScope = fix.StaticScope;
BoundScope = fix.BoundScope;
}
}
[CollectionDefinition("collection")]
public class StaticScriptContext : ICollectionFixture<StaticScriptFixture>
{
}
public class StaticScriptFixture
{
public EvaluationScope StaticScope { get; }
public BoundScope BoundScope { get; }
public StaticScriptFixture()
{
var (evaluationScope, boundScope) = Upsilon.StandardLibraries.StaticScope.CreateStandardLibrary();
StaticScope = evaluationScope;
BoundScope = boundScope;
}
}
}