예제 #1
0
        public void NoneHasNoValue()
        {
            var none = Opt.None <int>();

            none.IsSome
            .Is(false);

            Assert.Throws <InvalidOperationException>(() =>
                                                      Opt.None <string>().Value
                                                      );
        }
예제 #2
0
 public void ItMapsNoneToNestedSome()
 {
     Opt.AllowNull(Opt.None <int>())
     .Is(Opt.Some(Opt.None <int>()));
 }
예제 #3
0
 public void ItMapsNullStructToNone()
 {
     Opt.AllowNull((int?)null)
     .Is(Opt.None <int>());
 }
예제 #4
0
 public void ItMapsNullReferenceToNone()
 {
     Opt.AllowNull((string)null)
     .Is(Opt.None <string>());
 }