Exemplo n.º 1
0
        public void Should_throw_correct_exception_when_resolved_constructors_are_used(DefaultExceptionThrowerTestCase testCase)
        {
            // Arrange
            var thrower = new DefaultExceptionThrower();

            // Act
            var exception = Record.Exception(
                () => thrower.ThrowFailedToGenerateProxyWithResolvedConstructors(
                    testCase.TypeOfFake, testCase.ReasonForFailureOfDefaultConstructor, testCase.ResolvedConstructors));

            // Assert
            exception.Should()
            .BeAnExceptionOfType <FakeCreationException>()
            .WithMessage(testCase.ExpectedMessage);
        }
        public void Should_throw_correct_exception_when_resolved_constructors_are_used(DefaultExceptionThrowerTestCase testCase)
        {
            // Arrange
            var thrower = new DefaultExceptionThrower();

            // Act
            var exception = Record.Exception(
                () => thrower.ThrowFailedToGenerateProxyWithResolvedConstructors(
                    testCase.TypeOfFake, testCase.ReasonForFailureOfDefaultConstructor, testCase.ResolvedConstructors));

            // Assert
            exception.Should()
                .BeAnExceptionOfType<FakeCreationException>()
                .WithMessage(testCase.ExpectedMessage);
        }