Exemplo n.º 1
0
        public void TestAssemblyMetadataAttribute_PropertyOptions(string testInput, ImplicitNullabilityPropertyOptions expected)
        {
            void ChangeSolutionSettings(IContextBoundSettingsStore settingsStore) =>
            settingsStore.EnableImplicitNullability();

            var configuration = GetImplicitNullabilityConfigurationFor(testInput, ChangeSolutionSettings);

            Assert.That(configuration.HasAppliesTo(ImplicitNullabilityAppliesTo.Properties));
            Assert.That(configuration.PropertyOptions, Is.EqualTo(expected));
        }
Exemplo n.º 2
0
 public ImplicitNullabilityConfiguration(
     ImplicitNullabilityAppliesTo appliesTo,
     ImplicitNullabilityFieldOptions fieldOptions,
     ImplicitNullabilityPropertyOptions propertyOptions,
     GeneratedCodeOptions generatedCode)
 {
     AppliesTo       = appliesTo;
     FieldOptions    = fieldOptions;
     PropertyOptions = propertyOptions;
     GeneratedCode   = generatedCode;
 }
Exemplo n.º 3
0
 public bool HasPropertyOption(ImplicitNullabilityPropertyOptions flag) => (PropertyOptions & flag) > 0;