Ejemplo n.º 1
0
        public void UpdateCourseOptions_updates_course_options_successfully()
        {
            using var transaction = new TransactionScope();

            // Given
            const int customisationId = 100;
            const int centreId        = 101;
            int?      categoryId      = null;

            var defaultCourseOptions = new CourseOptions
            {
                Active              = true,
                DiagObjSelect       = true,
                SelfRegister        = false,
                HideInLearnerPortal = false,
            };

            try
            {
                // When
                courseDataService.UpdateCourseOptions(defaultCourseOptions, customisationId);
                var updatedCourseOptions = courseDataService.GetCourseOptionsFilteredByCategory(
                    customisationId,
                    centreId,
                    categoryId
                    ) !;

                // Then
                using (new AssertionScope())
                {
                    updatedCourseOptions.Active.Should().BeTrue();
                    updatedCourseOptions.DiagObjSelect.Should().BeTrue();
                    updatedCourseOptions.SelfRegister.Should().BeFalse();
                    updatedCourseOptions.HideInLearnerPortal.Should().BeFalse();
                }
            }
            finally
            {
                transaction.Dispose();
            }
        }