예제 #1
0
        public void Exceptional_OnException_SuccessIsFalse()
        {
            var example = new ThrowMyToys();
            var x       = example.ThrowAnException();

            Assert.False(x.Success);
            Assert.True(x.Exception);
        }
예제 #2
0
        public void Exceptional_OnException_Exception()
        {
            var example = new ThrowMyToys();
            var x       = example.ThrowAnException();

            x.Match(
                Exception: ex => Assert.IsType <NullReferenceException>(ex),
                Success: s => Assert.True(false)//force fail if this is called
                );
        }