/
githubmirror
/
roslyn
Обзор
Документация
Войти
/
githubmirror
/
roslyn
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/Workspaces/CoreTestUtilities/Options/TestOption.cs
38 строк
1 KB
Cyrus Najmabadi
Make sealed
26 мар 2025, 22:21
26 мар 2025, 22:21
d99b771
Код
Авторство
О чём код?
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. using System; using System.Collections.Immutable; using Microsoft.CodeAnalysis.Options; namespace Microsoft.CodeAnalysis.UnitTests; internal sealed class TestOption : IOption { public string Feature { get; set; } = "test"; public string Name { get; set; } = "test"; public Type Type { get; set; } = typeof(int); public object? DefaultValue { get; set; } = 1; public bool IsPerLanguage { get; set; } public ImmutableArray<OptionStorageLocation> StorageLocations { get; set; } } #pragma warning disable RS0030 // Do not used banned APIs internal sealed class TestOption<T> : Option<T> { public TestOption(string feature = "test", string name = "test", T? defaultValue = default, OptionStorageLocation[]? storageLocations = null) : base(feature, name, defaultValue!, storageLocations ?? []) { } } internal sealed class PerLanguageTestOption<T> : PerLanguageOption<T> { public PerLanguageTestOption(string feature = "test", string name = "test", T? defaultValue = default, OptionStorageLocation[]? storageLocations = null) : base(feature, name, defaultValue!, storageLocations ?? []) { } } #pragma warning restore