19 references to GetVariable
Microsoft.CodeAnalysis.CSharp.Scripting.UnitTests (19)
ScriptTests.cs (19)
407Assert.Equal(3m, state.GetVariable("a").Value); 408Assert.Equal(2u, state.GetVariable("b").Value); 409Assert.Equal(5m, state.GetVariable("x").Value); 410Assert.Equal(20, state.GetVariable("X").Value); 412Assert.Null(state.GetVariable("A")); 413Assert.Same(state.GetVariable("X"), state.GetVariable("X")); 422s1.GetVariable("x").Value = 2; 423Assert.Equal(2, s1.GetVariable("x").Value); 427Assert.Equal(1, s2.GetVariable("x").Value); 431Assert.Equal(2, s3.GetVariable("x").Value); 444Assert.False(state.GetVariable("x").IsReadOnly); 445Assert.True(state.GetVariable("y").IsReadOnly); 446Assert.True(state.GetVariable("z").IsReadOnly); 448Assert.Throws<ArgumentException>(() => state.GetVariable("x").Value = "str"); 449Assert.Throws<InvalidOperationException>(() => state.GetVariable("y").Value = "str"); 450Assert.Throws<InvalidOperationException>(() => state.GetVariable("z").Value = "str"); 451Assert.Throws<InvalidOperationException>(() => state.GetVariable("y").Value = 0); 452Assert.Throws<InvalidOperationException>(() => state.GetVariable("z").Value = 0);