Пример #1
0
        public static void GetValueOrDefault_ReturnsNullableValue_IfDictionaryTValueIsNullable()
        {
            var dictionary = new Dictionary <string, string?>();
            var value      = dictionary.GetValueOrDefault("x");

            CompilerAssert.Nullable(ref value);
        }
Пример #2
0
        public static void GetValueOrDefault_ReturnsNullableValue_IfDictionaryTValueIsNotNullable_ForIReadOnlyDictionary()
        {
            var dictionary = (IReadOnlyDictionary <string, string>) new Dictionary <string, string>();
            var value      = dictionary.GetValueOrDefault("x");

            CompilerAssert.Nullable(ref value);
        }
Пример #3
0
 public static void Except_AllowsNullItem()
 {
     CompilerAssert.NotNullable(new string?[0].Except(null));
 }
Пример #4
0
 public static void EmptyIfNull_ReturnsNotNullable()
 {
     CompilerAssert.NotNullable(new string[0].EmptyIfNull());
 }
        public static void NullIfEmpty_ReturnsNullable()
        {
            var value = "".NullIfEmpty();

            CompilerAssert.Nullable(ref value);
        }