Example #1
0
        public void CheckForNullsNonNullStringInputDoesNotThrowArgumentNullException()
        {
            const string verifying = "I'm not null";
            var          validator = new InputValidator();

            Assert.DoesNotThrow(() => validator.CheckForNulls(verifying, nameof(verifying)));
        }
Example #2
0
        public void CheckForNullsNonNullIntInputDoesNotThrowArgumentNullException()
        {
            const int verifying = 0;
            var       validator = new InputValidator();

            Assert.DoesNotThrow(() => validator.CheckForNulls(verifying, nameof(verifying)));
        }
Example #3
0
        public void CheckForNullsNonNullListInputDoesNotThrowArgumentNullException()
        {
            List <string> verifying = new List <string>()
            {
                "I'm not null"
            };
            var validator = new InputValidator();

            Assert.DoesNotThrow(() => validator.CheckForNulls(verifying, nameof(verifying)));
        }
Example #4
0
        public void CheckForNullsNullInputThrowsArgumentNullException()
        {
            const string expected  = "Input Parameter (verifying) was null or empty (Parameter 'verifying')";
            const object verifying = null;
            var          validator = new InputValidator();


            Assert.Multiple(() =>
            {
                var exception = Assert.Throws <ArgumentNullException>(() => validator.CheckForNulls(verifying, nameof(verifying)));
                Assert.AreEqual(expected, exception.Message);
            });
        }