Exemplo n.º 1
0
        public void given_employee_with_long_firstname_and_lastname_when_validating_should_return_error_about_full_name_being_too_long()
        {
            var employee = new Employee
            {
                FirstName = "ToddMeinershagenToddMeinershagenToddMeinershagen",
                LastName = "ToddMeinershagenToddMeinershagenToddMeinershagen"
            };

	        var results = new List<ValidationResult>();
            employee.TryValidate(results)
                .Should().BeFalse();

			results.Should()
                .Contain(x => x.ErrorMessage == "The full name must not be longer than 100 characters.");
        }