示例#1
0
        public void RemoveGroupCourseViewModel_Validate_returns_error_when_confirm_is_false()
        {
            // Given
            var model = new RemoveGroupCourseViewModel();

            // When
            var result = model.Validate(new ValidationContext(model)).ToList();

            // Then
            result.Should().NotBeEmpty();
            result.ElementAt(0).ErrorMessage.Should().Be("Confirm you wish to remove this course");
        }
示例#2
0
        public void RemoveGroupCourseViewModel_Validate_does_not_return_error_when_confirm_is_true()
        {
            // Given
            var model = new RemoveGroupCourseViewModel
            {
                Confirm = true,
            };

            // When
            var result = model.Validate(new ValidationContext(model));

            // Then
            result.Should().BeEmpty();
        }