37 references to GetMetadataContext
Microsoft.CodeAnalysis.CSharp.ExpressionEvaluator.ExpressionCompiler.UnitTests (37)
ExpressionCompilerTests.cs (19)
366Assert.NotEqual(context, GetMetadataContext(previous).EvaluationContext); // Not required, just documentary.
371Assert.NotEqual(context, GetMetadataContext(previous).EvaluationContext);
373Assert.Equal(context.Compilation, GetMetadataContext(previous).Compilation);
381var constraints = GetMetadataContext(previous).EvaluationContext.MethodContextReuseConstraints;
388var previousEvaluationContext = GetMetadataContext(previous).EvaluationContext;
400Assert.Equal(context.Compilation, GetMetadataContext(previous).Compilation);
414Assert.NotEqual(context, GetMetadataContext(previous).EvaluationContext);
415Assert.True(GetMetadataContext(previous).EvaluationContext.MethodContextReuseConstraints.Value.AreSatisfied(moduleVersionId, methodToken, methodVersion, endOffset));
416Assert.NotEqual(context.Compilation, GetMetadataContext(previous).Compilation);
422Assert.NotEqual(context, GetMetadataContext(previous).EvaluationContext);
423Assert.False(GetMetadataContext(previous).EvaluationContext.MethodContextReuseConstraints.Value.AreSatisfied(moduleVersionId, methodToken, methodVersion, 0));
424Assert.Equal(context.Compilation, GetMetadataContext(previous).Compilation);
427appDomain.SetMetadataContext(SetMetadataContext(previous, default(Guid), new CSharpMetadataContext(GetMetadataContext(previous).Compilation)));
429Assert.Null(GetMetadataContext(previous).EvaluationContext);
430Assert.NotNull(GetMetadataContext(previous).Compilation);
432Assert.Null(GetMetadataContext(previous).EvaluationContext);
434Assert.Equal(context.Compilation, GetMetadataContext(previous).Compilation);
6310Assert.Same(GetMetadataContext(previous).EvaluationContext, context);
6323Assert.Same(GetMetadataContext(previous).EvaluationContext, context);
ReferencedModulesTests.cs (18)
392Assert.NotSame(context, GetMetadataContext(previous, mvidB1).EvaluationContext);
393Assert.Same(context.Compilation, GetMetadataContext(previous, mvidB1).Compilation);
399Assert.NotSame(context, GetMetadataContext(previous, mvidB1).EvaluationContext);
400Assert.NotSame(context.Compilation, GetMetadataContext(previous, mvidB1).Compilation);
406Assert.NotSame(context, GetMetadataContext(previous, mvidA1).EvaluationContext);
407Assert.NotSame(context.Compilation, GetMetadataContext(previous, mvidA1).Compilation);
413Assert.NotSame(context, GetMetadataContext(previous, mvidA2).EvaluationContext);
414Assert.Same(context.Compilation, GetMetadataContext(previous, mvidA2).Compilation);
427Assert.NotSame(context, GetMetadataContext(previous, mvidA1).EvaluationContext);
428Assert.NotSame(context.Compilation, GetMetadataContext(previous, mvidA1).Compilation);
434Assert.NotSame(context, GetMetadataContext(previous, mvidA2).EvaluationContext);
435Assert.Same(context.Compilation, GetMetadataContext(previous, mvidA2).Compilation);
441Assert.NotSame(context, GetMetadataContext(previous, mvidA2).EvaluationContext);
442Assert.NotSame(context.Compilation, GetMetadataContext(previous, mvidA2).Compilation);
448Assert.NotSame(context, GetMetadataContext(previous, mvidB1).EvaluationContext);
449Assert.Same(context.Compilation, GetMetadataContext(previous, mvidB1).Compilation);
720Assert.NotSame(GetMetadataContext(previous).EvaluationContext, context);
721Assert.Same(GetMetadataContext(previous).Compilation, context.Compilation); // re-use type context compilation