コード例 #1
0
        public void Should_return_0_expectation_groups_when_expressions_are_empty()
        {
            // Arrange
            var expecatationExpressions = new List<ExpectationExpression>();
            var expecationBuilder = new ExpectationGroupBuilder();

            // Act
            var expectationGroups = expecationBuilder.Build(expecatationExpressions);

            // Assert
            Assert.That(expectationGroups.Count(), Is.EqualTo(0));
        }
コード例 #2
0
        public void Should_return_4_expectation_groups_for_1_expression()
        {
            // Arrange
            var expecatationExpressions = new List<ExpectationExpression> { new ExpectationExpression<AdminController>() };
            var expecationBuilder = new ExpectationGroupBuilder();

            // Act
            var expectationGroups = expecationBuilder.Build(expecatationExpressions);

            // Assert
            Assert.That(expectationGroups.Count(), Is.EqualTo(4));
        }
コード例 #3
0
        public void Should_return_5_expectation_groups_for_2_expressions()
        {
            // Arrange
            var expecatationExpressions = new List<ExpectationExpression>
            {
                new ExpectationExpression<AdminController>(),
                new ExpectationExpression<SampleController>(x => x.Index())
            };
            var expecationBuilder = new ExpectationGroupBuilder();

            // Act
            var expectationGroups = expecationBuilder.Build(expecatationExpressions);

            // Assert
            Assert.That(expectationGroups.Count(), Is.EqualTo(5));
        }
コード例 #4
0
 public void Should_throw_when_expressions_are_null()
 {
     var expectationBuilder = new ExpectationGroupBuilder();
     Assert.Throws<ArgumentNullException>(() => expectationBuilder.Build(null));
 }