public static void GetValueOrDefault_ReturnsNullableValue_IfDictionaryTValueIsNullable() { var dictionary = new Dictionary <string, string?>(); var value = dictionary.GetValueOrDefault("x"); CompilerAssert.Nullable(ref value); }
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 Except_AllowsNullItem() { CompilerAssert.NotNullable(new string?[0].Except(null)); }
public static void EmptyIfNull_ReturnsNotNullable() { CompilerAssert.NotNullable(new string[0].EmptyIfNull()); }
public static void NullIfEmpty_ReturnsNullable() { var value = "".NullIfEmpty(); CompilerAssert.Nullable(ref value); }