Esempio n. 1
0
        public void ValidTest()
        {
            var test = new DoesNotContainCharacterTestClass("test something.com");

            Assert.IsTrue(test.Validate());
            Assert.IsTrue(test.Errors.Count == 0);
        }
Esempio n. 2
0
        public void NullValueTest()
        {
            var test = new DoesNotContainCharacterTestClass(null);

            Assert.IsTrue(test.Validate());
            Assert.IsTrue(test.Errors.Count == 0);
        }
Esempio n. 3
0
        public void InvalidTest()
        {
            var test = new DoesNotContainCharacterTestClass("*****@*****.**");

            Assert.IsFalse(test.Validate());
            Assert.IsTrue(test.Errors.Count == 1);
            Assert.IsTrue(test.Errors[0] == $"{nameof(test.Value)} is invalid as it does" +
                          " contain a '@'");
        }