示例#1
0
        public void AddNullValidationPredicate()
        {
            // Arrange.
            ValidatableArgument <int?> argument = new ValidatableArgument <int?>("argument", 5);

            // Act.
            argument.IsNotNull();

            // Assert.
            Assert.AreEqual(1, argument.ValidationPredicates.Count());
            Assert.IsInstanceOfType(argument.ValidationPredicates.First(), typeof(NullableNotNullValidationPredicate <int>));
        }
        public void AddNullableNotNullValidationPredicate()
        {
            // Arrange.
            ValidatableArgument<int?> argument = new ValidatableArgument<int?>("argument", 5);

            // Act.
            argument.IsNotNull();

            // Assert.
            Assert.AreEqual(1, argument.ValidationPredicates.Count());
            Assert.IsInstanceOfType(argument.ValidationPredicates.First(), typeof(NullableNotNullValidationPredicate<int>));
        }
示例#3
0
        public void RunInExpectedTime()
        {
            // Arrange.
            ValidatableArgument <int?> argument = new ValidatableArgument <int?>("argument", 5);

            // Act & Assert.
            Ensure.ActionRunsInExpectedTime(
                () =>
            {
                argument.IsNotNull();
            },
                PerformanceConstants.ValidationPredicateExecutionCount,
                PerformanceConstants.ValidationPredicateTotalExecutionExpectedTime);
        }
        public void RunInExpectedTime()
        {
            // Arrange.
            ValidatableArgument<int?> argument = new ValidatableArgument<int?>("argument", 5);

            // Act & Assert.
            Ensure.ActionRunsInExpectedTime(
                () =>
                {
                    argument.IsNotNull();
                },
                PerformanceConstants.ValidationPredicateExecutionCount,
                PerformanceConstants.ValidationPredicateTotalExecutionExpectedTime);
        }