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

            CompilerAssert.Nullable(ref value);
        }