public void can_extract_null_out_of_none() { MaybeNonGenericFactory.TryGetValue(Maybe.None <int>(), typeof(int)) .Should().BeNull(); MaybeNonGenericFactory.TryGetValue(Maybe.None <int?>(), typeof(int?)) .Should().BeNull(); MaybeNonGenericFactory.TryGetValue(Maybe.None <string>(), typeof(string)) .Should().BeNull(); }
public void can_extract_value_out_of_some() { MaybeNonGenericFactory.TryGetValue(Maybe.Some(10), typeof(int)) .Should().Be(10); MaybeNonGenericFactory.TryGetValue(Maybe.Some <int?>(10), typeof(int?)) .Should().Be(10); MaybeNonGenericFactory.TryGetValue(Maybe.Some("aaa"), typeof(string)) .Should().Be("aaa"); }