using System.Collections.Generic; using Upsilon.Evaluator; using Xunit; namespace UpsilonTests.GeneralTests { public class UserDataDictionaryTests : TestClass { [Fact] public void BasicStringKeyed() { var arr = new Dictionary { {"test", 100}, {"1234", 90}, {"here", 1683}, }; const string input = @" function getValue(arr) return arr[""here""] end "; var script = new Script(input, BoundScope, StaticScope); Assert.Empty(script.Diagnostics.Messages); var evaluated = script.EvaluateFunction("getValue", new[] {arr}); Assert.Empty(script.Diagnostics.Messages); Assert.Equal(1683, evaluated); } public UserDataDictionaryTests(StaticScriptFixture fix) : base(fix) { } } }