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