8 references to WithLanguageVersion
Microsoft.CodeAnalysis.CSharp.Scripting.UnitTests (8)
ScriptOptionsTests.cs (4)
22
var options = ScriptOptions.Default.
WithLanguageVersion
(LanguageVersion.CSharp8);
29
var options = ScriptOptions.Default.
WithLanguageVersion
(LanguageVersion.CSharp8);
30
Assert.Same(options, options.
WithLanguageVersion
(LanguageVersion.CSharp8));
37
Assert.Throws<InvalidOperationException>(() => options.
WithLanguageVersion
(LanguageVersion.CSharp8));
ScriptTests.cs (4)
475
var state0 = await CSharpScript.RunAsync("static int Add(int x, int y) => x + y;", options: ScriptOptions.
WithLanguageVersion
(LanguageVersion.Preview));
955
var script = CSharpScript.Create(@"string x = default;", ScriptOptions.
WithLanguageVersion
(LanguageVersion.CSharp7));
969
string x = null;", ScriptOptions.
WithLanguageVersion
(LanguageVersion.CSharp8));
991
var script = CSharpScript.Create(code, ScriptOptions.
WithLanguageVersion
(LanguageVersion.CSharp8));