コード例 #1
0
        public void ShouldHaveActionActionAvailableThroughProperty_WhenExpectingAnException()
        {
            WhenLastActionDeferred(Exploding);

            ThenLastAction.Should().NotBeNull();
            ThenLastAction.Should().Throw <Exception>("Did I do that?");
        }
コード例 #2
0
        public void ShouldThrowException_WhenCreatingIEnumerable_GivenDidNotCallPrepare()
        {
            Given.HowMany = 10;

            WhenLastActionDeferred(CreatingIEnumerable);

            ThenLastAction.Should().Throw <InvalidOperationException>();
        }
コード例 #3
0
        public void ShouldNotThrowException_WhenPreparing()
        {
            WhenLastActionDeferred(Preparing);

            ThenLastAction.Should().NotThrow();
        }
コード例 #4
0
        public void ShouldThrowException_WhenCreatingModel_GivenDidNotCallPrepare()
        {
            WhenLastActionDeferred(CreatingModel);

            ThenLastAction.Should().Throw <InvalidOperationException>();
        }