Пример #1
0
            public Test()
            {
                SolutionTransforms.Add((solution, projectId) =>
                {
                    var compilationOptions = solution.GetProject(projectId).CompilationOptions;
                    compilationOptions     = compilationOptions.WithSpecificDiagnosticOptions(
                        compilationOptions.SpecificDiagnosticOptions.SetItems(CSharpVerifierHelper.NullableWarnings));
                    solution = solution.WithProjectCompilationOptions(projectId, compilationOptions);

                    return(solution);
                });

                TestState.AdditionalReferences.AddRange(new[]
                {
                    MetadataReferenceFactory.CreateFromType <IGenericTypeConstraintAttribute>(),
                    MetadataReferenceFactory.CreateFromType <ExampleAttribute>(),
                });
            }
 private static IEnumerable <PortableExecutableReference> MapToMetadataReferences(IEnumerable <Type> requiredTypes)
 {
     return(requiredTypes.Select(t => MetadataReferenceFactory.CreateFromType(t)));
 }