コード例 #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
                );
        }