176 references to CreateSubmission
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (31)
CodeGen\CodeGenScriptTests.cs (29)
212
var s0 =
CreateSubmission
("var x = new { a = 1 }; ");
213
var sx =
CreateSubmission
("var y = new { b = 2 }; ", previous: s0);
214
var s1 =
CreateSubmission
("var y = new { b = new { a = 3 } };", previous: s0);
215
var s2 =
CreateSubmission
("x = y.b; ", previous: s1);
238
var s0 =
CreateSubmission
("var i = 1; dynamic d = null; d.m(ref i);", references);
239
var sx =
CreateSubmission
("var i = 1; dynamic d = null; d.m(ref i, ref i);", references, previous: s0);
240
var s1 =
CreateSubmission
("var i = 1; dynamic d = null; d.m(out i);", references, previous: s0);
259
var s0 =
CreateSubmission
("int a = 1;");
260
var s11 =
CreateSubmission
("a + 1", previous: s0);
261
var s12 =
CreateSubmission
("a + 2", previous: s0);
270
var c0 =
CreateSubmission
(@"
277
var c1 =
CreateSubmission
(@"
292
var c0 =
CreateSubmission
(@"
299
var c1 =
CreateSubmission
(@"
314
var c0 =
CreateSubmission
(@"
321
var c1 =
CreateSubmission
(@"
336
var c0 =
CreateSubmission
(@"
343
var c1 =
CreateSubmission
(@"
358
var c0 =
CreateSubmission
(@"
375
var c0 =
CreateSubmission
(@"
382
var c1 =
CreateSubmission
(@"
397
var c0 =
CreateSubmission
(@"
407
var c1 =
CreateSubmission
(@"
422
var c0 =
CreateSubmission
(@"
442
var c0 =
CreateSubmission
(@"
464
var c0 =
CreateSubmission
(@"
477
var s0 =
CreateSubmission
("int Goo() { return 2;}");
478
var s1 =
CreateSubmission
("(4 + 5) * Goo()", previous: s0);
648
var s =
CreateSubmission
(test);
CodeGen\GotoTest.cs (2)
1179
compilation =
CreateSubmission
(source);
1213
compilation =
CreateSubmission
(source);
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (111)
Semantics\InteractiveUsingTests.cs (50)
23
var sub =
CreateSubmission
("using System; typeof(String)");
32
var sub =
CreateSubmission
("using I = System.Int32; typeof(I)");
41
var sub =
CreateSubmission
("using static System.Environment; NewLine");
51
var sub1 =
CreateSubmission
(
57
var sub2 =
CreateSubmission
(
63
var sub3 =
CreateSubmission
(
80
var sub = (Compilation)
CreateSubmission
(source);
103
var sub1 =
CreateSubmission
("class A { }");
104
var sub2 =
CreateSubmission
("class B : A { }", previous: sub1);
105
var sub3 =
CreateSubmission
("class C : B { }", previous: sub2);
107
CreateSubmission
("using A1 = A;", previous: sub3).VerifyDiagnostics();
108
CreateSubmission
("using B1 = B;", previous: sub3).VerifyDiagnostics();
110
var sub4 =
CreateSubmission
("using C1 = C; typeof(C1)", previous: sub3);
143
CreateSubmission
(source).GetDiagnostics().Verify(expectedDiagnostics);
162
CreateSubmission
(source, options: options).GetDiagnostics().Verify(expectedDiagnostics);
180
CreateSubmission
(source).GetDiagnostics().Verify(expectedDiagnostics);
186
var sub1 =
CreateSubmission
("using A = System.Int32; typeof(A)");
189
var sub2 =
CreateSubmission
("using A = System.Int16; typeof(A)", previous: sub1);
192
var sub3 =
CreateSubmission
("class A { }", previous: sub2);
195
var sub4 =
CreateSubmission
("using A = System.Int64; typeof(A)", previous: sub3);
212
var sub = (Compilation)
CreateSubmission
(source);
222
var sub1 =
CreateSubmission
("class A { public static int AA; }");
223
var sub2 =
CreateSubmission
("class B { public static int BB; }", previous: sub1);
224
var sub3 =
CreateSubmission
("class C { public static int CC; }", previous: sub2);
226
CreateSubmission
("using static A;", previous: sub3).VerifyDiagnostics();
227
CreateSubmission
("using static B;", previous: sub3).VerifyDiagnostics();
229
var sub4 =
CreateSubmission
("using static C;", previous: sub3);
252
CreateSubmission
(source).GetDiagnostics().Verify(expectedDiagnostics);
271
CreateSubmission
(source, options: options).GetDiagnostics().Verify(expectedDiagnostics);
277
CreateSubmission
("using System; using System;").VerifyDiagnostics(
286
CreateSubmission
("using System;", previous:
CreateSubmission
("using System;")).VerifyDiagnostics();
292
CreateSubmission
("typeof(String)", options: TestOptions.DebugDll.WithUsings("System", "System")).VerifyDiagnostics();
300
var sub1 =
CreateSubmission
("typeof(String)", options: options);
303
var sub2 =
CreateSubmission
("typeof(String)", options: options, previous: sub1);
327
var sub1 =
CreateSubmission
("using A; typeof(A1) == typeof(B1)", new[] { lib1 }, options);
330
var sub2 =
CreateSubmission
("typeof(A1) == typeof(B1) && typeof(A2) == typeof(B2)", new[] { lib1, lib2 }, options: options, previous: sub1);
363
var compilation =
CreateSubmission
(
434
var compilation =
CreateSubmission
(
437
previous:
CreateSubmission
(previousSubmissionSource));
484
var compilation =
CreateSubmission
(
533
var curr =
CreateSubmission
(submission, refs, previous: prev);
559
CreateSubmission
("using NInner;", refs, previous:
CreateSubmission
("using NOuter;", refs)).VerifyDiagnostics(
564
CreateSubmission
("using NI = NInner;", refs, previous:
CreateSubmission
("using NOuter;", refs)).VerifyDiagnostics(
569
CreateSubmission
("using static COuter;", refs, previous:
CreateSubmission
("using NOuter;", refs)).VerifyDiagnostics(
574
CreateSubmission
("using static NInner.CInner;", refs, previous:
CreateSubmission
("using NOuter;", refs)).VerifyDiagnostics(
Semantics\LocalFunctionTests.cs (10)
5141
CreateSubmission
(source, new[] { ScriptTestFixtures.HostRef }, hostObjectType: typeof(ScriptGlobals))
5157
CreateSubmission
(source, new[] { ScriptTestFixtures.HostRef }, hostObjectType: typeof(ScriptGlobals))
5164
var previous =
CreateSubmission
("int previousSubmissionVariable = 42;")
5176
CreateSubmission
(source, previous: previous)
5183
var previous =
CreateSubmission
("int previousSubmissionVariable = 42;")
5195
CreateSubmission
(source, previous: previous)
5202
var previous =
CreateSubmission
("void PreviousSubmissionMethod() { }")
5214
CreateSubmission
(source, previous: previous)
5221
var previous =
CreateSubmission
("void PreviousSubmissionMethod() { }")
5233
CreateSubmission
(source, previous: previous)
Semantics\ScriptSemanticsTests.cs (51)
322
var c =
CreateSubmission
(@"
508
var submission =
CreateSubmission
(source);
552
var compilation =
CreateSubmission
(test);
583
var compilation =
CreateSubmission
(text);
612
var submission =
CreateSubmission
("x",
661
var compilation =
CreateSubmission
(source);
677
var compilation =
CreateSubmission
(source);
695
var c0 =
CreateSubmission
(source0);
703
var c1 =
CreateSubmission
(source1, previous: c0);
712
var c0 =
CreateSubmission
(@"public class C { private static int goo() { return 1; } }");
713
var c1 =
CreateSubmission
(@"C.goo()", previous: c0);
723
var c0 =
CreateSubmission
(@"
731
var c1 =
CreateSubmission
(@"
756
CreateSubmission
(@"protected A x;", previous: c1).VerifyDiagnostics(
762
CreateSubmission
(@"internal A x;", previous: c1).VerifyDiagnostics(
766
CreateSubmission
(@"internal protected A x;", previous: c1).VerifyDiagnostics(
772
CreateSubmission
(@"public A x;", previous: c1).VerifyDiagnostics(
776
CreateSubmission
(@"internal B x;", previous: c1).VerifyDiagnostics(
780
CreateSubmission
(@"internal protected B x;", previous: c1).VerifyDiagnostics(
786
CreateSubmission
(@"public B x;", previous: c1).VerifyDiagnostics(
794
var c0 =
CreateSubmission
(@"
799
var c1 =
CreateSubmission
("s + i", previous: c0, returnType: typeof(int));
800
var c2 =
CreateSubmission
("static int t = i;", previous: c1);
808
var c0 =
CreateSubmission
(@"
814
var c1 =
CreateSubmission
(@"
831
var c0 =
CreateSubmission
(@"
848
var c0 =
CreateSubmission
(@"
851
var c1 =
CreateSubmission
(@"
869
var s0 =
CreateSubmission
("int a = \"x\";");
874
Assert.Throws<InvalidOperationException>(() =>
CreateSubmission
("a + 1", previous: s0));
881
var submission =
CreateSubmission
("using Unknown;");
896
var c =
CreateSubmission
("Z()", new[] { HostRef });
912
var c =
CreateSubmission
(source, new[] { HostRef }, hostObjectType: typeof(C));
931
var c =
CreateSubmission
("int i = 42l;");
943
var c =
CreateSubmission
("var x = x;");
953
var c =
CreateSubmission
("var x = 1; { var x = x;}");
965
var c =
CreateSubmission
(
990
var c =
CreateSubmission
(
1014
var c =
CreateSubmission
(@"
1032
var c0 =
CreateSubmission
("var x = 1;");
1033
var c1 =
CreateSubmission
("&x", previous: c0);
1044
var c0 =
CreateSubmission
("&x", new[] { HostRef }, hostObjectType: typeof(B2));
1058
var c0 =
CreateSubmission
(source, new[] { SystemCoreRef });
1069
var s0 =
CreateSubmission
("int i = 5;");
1070
var s1 =
CreateSubmission
("i* i", previous: s0);
1071
var s2 =
CreateSubmission
("i* i;", previous: s1);
1086
var s0 =
CreateSubmission
(@"
1097
var s0 =
CreateSubmission
("goto Object;");
1111
var s0 =
CreateSubmission
("static void E(this object o) { }", references);
1113
var s1 =
CreateSubmission
("void F(this object o) { }", references, previous: s0);
1120
var s2 =
CreateSubmission
("static void G(this dynamic o) { }", references, previous: s0);
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (34)
Compilation\CompilationAPITests.cs (32)
2431
Assert.True(
CreateSubmission
("1", parseOptions: TestOptions.Script).HasSubmissionResult());
2432
Assert.False(
CreateSubmission
("1;", parseOptions: TestOptions.Script).HasSubmissionResult());
2433
Assert.False(
CreateSubmission
("void goo() { }", parseOptions: TestOptions.Script).HasSubmissionResult());
2434
Assert.False(
CreateSubmission
("using System;", parseOptions: TestOptions.Script).HasSubmissionResult());
2435
Assert.False(
CreateSubmission
("int i;", parseOptions: TestOptions.Script).HasSubmissionResult());
2436
Assert.False(
CreateSubmission
("System.Console.WriteLine();", parseOptions: TestOptions.Script).HasSubmissionResult());
2437
Assert.False(
CreateSubmission
("System.Console.WriteLine()", parseOptions: TestOptions.Script).HasSubmissionResult());
2438
Assert.True(
CreateSubmission
("null", parseOptions: TestOptions.Script).HasSubmissionResult());
2439
Assert.True(
CreateSubmission
("System.Console.WriteLine", parseOptions: TestOptions.Script).HasSubmissionResult());
2448
var s0 =
CreateSubmission
("int a = \"x\";");
2453
Assert.Throws<InvalidOperationException>(() =>
CreateSubmission
("a + 1", previous: s0));
3155
var script =
CreateSubmission
("return null;", returnType: typeof(object));
3163
var script =
CreateSubmission
("return \"¡Hola!\";", returnType: typeof(object));
3171
var script =
CreateSubmission
("return 42;", returnType: typeof(object));
3179
var script =
CreateSubmission
("return", returnType: typeof(object));
3193
var script =
CreateSubmission
("return 42;", returnType: typeof(int));
3202
var script =
CreateSubmission
("return 42;", returnType: null);
3210
var script =
CreateSubmission
("return 42", returnType: typeof(uint));
3221
var script =
CreateSubmission
("return await System.Threading.Tasks.Task.FromResult(42);", returnType: typeof(int));
3225
script =
CreateSubmission
("return await System.Threading.Tasks.Task.FromResult(42);", returnType: typeof(Task<int>));
3236
var script =
CreateSubmission
("return System.Threading.Tasks.Task.FromResult(42);", returnType: typeof(int));
3247
var script =
CreateSubmission
(@"
3264
var script =
CreateSubmission
(@"
3276
script =
CreateSubmission
(@"
3292
var script =
CreateSubmission
(@"
3306
var script =
CreateSubmission
(@"
3314
script =
CreateSubmission
(@"
3327
var script =
CreateSubmission
(@"
3336
script =
CreateSubmission
(@"
3346
var script =
CreateSubmission
(@"
3361
var script =
CreateSubmission
(@"
3377
var script =
CreateSubmission
(@"
Symbols\RequiredMembersTests.cs (1)
6277
var submission =
CreateSubmission
("""
Symbols\Source\FileModifierTests.cs (1)
4089
var comp =
CreateSubmission
(source1, parseOptions: TestOptions.Script.WithLanguageVersion(LanguageVersion.Preview));