Esempio n. 1
0
        public async Task Inherited_OnValidate()
        {
            var iv = new IntValidator();
            var vr = await iv.ValidateAsync(11);

            Assert.IsTrue(vr.HasError);
            Assert.AreEqual(1, vr.Messages.Count);
            Assert.AreEqual("Count is not allowed to be eleven.", vr.Messages[0].Text);
            Assert.AreEqual("Value", vr.Messages[0].Property);
        }
Esempio n. 2
0
        public async Task Inherited_Basic()
        {
            var iv = new IntValidator();
            var vr = await iv.ValidateAsync(8);

            Assert.IsTrue(vr.HasError);
            Assert.AreEqual(1, vr.Messages.Count);
            Assert.AreEqual("Count must be greater than or equal to 10.", vr.Messages[0].Text);
            Assert.AreEqual("Value", vr.Messages[0].Property);
        }