Ejemplo n.º 1
0
        public void ValidateFailTest()
        {
            //min > max
            MDPRangePercentage range = new MDPRangePercentage(85.0, 40.0);

            Assert.ThrowsException <ServiceException>(() => range.Validate());
        }
Ejemplo n.º 2
0
        public void CanCreateMdpRangePercentageTest()
        {
            var validator = new DataAnnotationsValidator();
            MDPRangePercentage             range = new MDPRangePercentage(35.0, 72.5);
            ICollection <ValidationResult> results;

            Assert.IsTrue(validator.TryValidate(range, out results));

            //too big max
            range = new MDPRangePercentage(35.0, 1000.0);
            Assert.IsFalse(validator.TryValidate(range, out results));
        }
Ejemplo n.º 3
0
        public void ValidateSuccessTest()
        {
            MDPRangePercentage range = new MDPRangePercentage(35.0, 72.5);

            range.Validate();
        }