19 references to GetVariable
Microsoft.CodeAnalysis.CSharp.Scripting.UnitTests (19)
ScriptTests.cs (19)
403Assert.Equal(3m, state.GetVariable("a").Value); 404Assert.Equal(2u, state.GetVariable("b").Value); 405Assert.Equal(5m, state.GetVariable("x").Value); 406Assert.Equal(20, state.GetVariable("X").Value); 408Assert.Null(state.GetVariable("A")); 409Assert.Same(state.GetVariable("X"), state.GetVariable("X")); 418s1.GetVariable("x").Value = 2; 419Assert.Equal(2, s1.GetVariable("x").Value); 423Assert.Equal(1, s2.GetVariable("x").Value); 427Assert.Equal(2, s3.GetVariable("x").Value); 440Assert.False(state.GetVariable("x").IsReadOnly); 441Assert.True(state.GetVariable("y").IsReadOnly); 442Assert.True(state.GetVariable("z").IsReadOnly); 444Assert.Throws<ArgumentException>(() => state.GetVariable("x").Value = "str"); 445Assert.Throws<InvalidOperationException>(() => state.GetVariable("y").Value = "str"); 446Assert.Throws<InvalidOperationException>(() => state.GetVariable("z").Value = "str"); 447Assert.Throws<InvalidOperationException>(() => state.GetVariable("y").Value = 0); 448Assert.Throws<InvalidOperationException>(() => state.GetVariable("z").Value = 0);