Esempio n. 1
0
        public void HasMaximumLength_IsFalse()
        {
            var target = new ArgumentConstraint <string>(new Argument <string>("a", "Hello"));

            Action work = () => target.HasMaximumLength(3);

            work.ShouldThrowArgumentException();
        }
Esempio n. 2
0
        public void HasMaximumLength_WithMessage()
        {
            var target          = new ArgumentConstraint <string>(new Argument <string>("a", "Hello"));
            var expectedMessage = "Testing";

            Action work = () => target.HasMaximumLength(3, expectedMessage);

            work.ShouldThrowArgumentException().ContainingMessage(expectedMessage);
        }
Esempio n. 3
0
        public void HasMaximumLength_IsTrue()
        {
            var target = new ArgumentConstraint <string>(new Argument <string>("a", "Hello"));

            target.HasMaximumLength(10);
        }
Esempio n. 4
0
        public void HasMaximumLength_IsNull()
        {
            var target = new ArgumentConstraint <string>(new Argument <string>("a", null));

            target.HasMaximumLength(1);
        }