Beispiel #1
0
        public void Should_have_expectation_verifyer_provider()
        {
            var configuration = FluentSecurityFactory.CreateEmptySecurityConfiguration();
            var handler       = _policyExpectations.ExpectationViolationHandler;

            Assert.That(_policyExpectations.ExpectationVerifyerProvider(configuration, handler).GetType(), Is.EqualTo(typeof(ExpectationVerifyer)));
        }
Beispiel #2
0
        public void Should_fail_11_times_and_return_14_results()
        {
            // Arrange
            var configuration = FluentSecurityFactory.CreateEmptySecurityConfiguration();

            var expectationViolationHandler = new Mock <IExpectationViolationHandler>();

            expectationViolationHandler.Setup(x => x.Handle(It.IsAny <string>())).Returns(ExpectationResult.CreateSuccessResult);

            var expectationVerifyer = new ExpectationVerifyer(configuration, expectationViolationHandler.Object);
            var expectationGroups   = FluentSecurityFactory.CreateExpectationsGroups();

            // Act
            var expectationResults = expectationVerifyer.VerifyExpectationsOf(expectationGroups);

            // Assert
            expectationViolationHandler.Verify(x => x.Handle(It.IsAny <string>()), Times.Exactly(11));
            Assert.That(expectationResults.Count(), Is.EqualTo(15));
        }