Esempio n. 1
0
        public void PositiveIntValidatesCorrectly(int value, bool isSuccess)
        {
            Assert.AreEqual(isSuccess, PositiveInt.Create(value).IsSuccess);

            var exceptionConstraint = isSuccess.Match <IConstraint>(
                t => Throws.Nothing,
                f => Throws.TypeOf <ArgumentException>()
                );

            Assert.That(() => PositiveInt.CreateUnsafe(value), exceptionConstraint);
        }