コード例 #1
0
        public void Calling_Method_Returns_right_message()
        {
            Action action = () =>
            {
                Calling.Method(() =>
                {
                    throw new Exception("x");
                }).Should().NotThrow();
            };

            action.Should().Throw <XunitException>();
        }
コード例 #2
0
        public void Calling_Function_Returns_right_message()
        {
            var    i      = 1;
            Action action = () =>
            {
                Calling.Function(() =>
                {
                    if (i > 0)
                    {
                        throw new Exception("x");
                    }
                    return(0);
                }).Should().NotThrow();
            };

            action.Should().Throw <XunitException>();
        }