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

            // Act.
            argument.IsNotNaN();

            // Assert.
            Assert.AreEqual(1, argument.ValidationPredicates.Count());
            Assert.IsInstanceOfType(argument.ValidationPredicates.First(), typeof(FloatNotNaNValidationPredicate));
        }
        public void AddFloatNotNaNValidationPredicate()
        {
            // Arrange.
            ValidatableArgument<float> argument =
                new ValidatableArgument<float>("argument", 5);

            // Act.
            argument.IsNotNaN();

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

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

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