public void AccessUninitialisedEitherMember() { var obj = new EitherClass(); match(obj.EitherValue, Right: r => Console.WriteLine(r), Left: l => Console.WriteLine(l) ); Assert.Throws <BottomException>( () => { match(obj.EitherOtherValue, Right: r => Console.WriteLine(r), Left: l => Console.WriteLine(l) ); } ); }
public void AccessUninitialisedEitherMember() { var obj = new EitherClass(); match(obj.EitherValue, Right: r => Console.WriteLine(r), Left: l => Console.WriteLine(l) ); Assert.Throws( typeof(EitherNotInitialisedException), () => { match(obj.EitherOtherValue, Right: r => Console.WriteLine(r), Left: l => Console.WriteLine(l) ); } ); }