コード例 #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());
 }
コード例 #5
0
        public static void NullIfEmpty_ReturnsNullable()
        {
            var value = "".NullIfEmpty();

            CompilerAssert.Nullable(ref value);
        }