コード例 #1
0
        public void ShouldThrowExceptionWhenThrowExceptionIsTrue()
        {
            var sampleEndpoint = new SampleEndpoint { ThrowException = true };

            Assert.That(() => sampleEndpoint.SampleMethod(null), Throws.Exception);
        }
コード例 #2
0
        public void ShouldNotThrowExceptionWhenThrowExceptionIsFalse()
        {
            var sampleEndpoint = new SampleEndpoint {ThrowException = false };

            Assert.That(() => sampleEndpoint.SampleMethod(null), Throws.Nothing);
        }